[macos][photosui] Make PHLivePhotoView available on macOS (#3136)

* PHLivePhotoView only available on 64 bits

xtro results:
!missing-enum! PHLivePhotoViewContentMode not bound
!missing-enum! PHLivePhotoViewPlaybackStyle not bound
!missing-protocol! PHLivePhotoViewDelegate not bound
!missing-selector! PHLivePhotoView::audioVolume not bound
!missing-selector! PHLivePhotoView::contentMode not bound
!missing-selector! PHLivePhotoView::delegate not bound
!missing-selector! PHLivePhotoView::isMuted not bound
!missing-selector! PHLivePhotoView::livePhoto not bound
!missing-selector! PHLivePhotoView::livePhotoBadgeView not bound
!missing-selector! PHLivePhotoView::setAudioVolume: not bound
!missing-selector! PHLivePhotoView::setContentMode: not bound
!missing-selector! PHLivePhotoView::setDelegate: not bound
!missing-selector! PHLivePhotoView::setLivePhoto: not bound
!missing-selector! PHLivePhotoView::setMuted: not bound
!missing-selector! PHLivePhotoView::startPlaybackWithStyle: not bound
!missing-selector! PHLivePhotoView::stopPlaybackAnimated: not bound
!missing-type! PHLivePhotoView not bound

* [xtro] Sort earlier in EnumCheck so we don't have to duplicate checks (or get random failures)
This commit is contained in:
Sebastien Pouliot 2017-12-28 08:51:34 -05:00 коммит произвёл GitHub
Родитель 8169c63aba
Коммит 02042741db
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 55 добавлений и 29 удалений

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

@ -2,7 +2,8 @@ using System;
using XamCore.ObjCRuntime;
namespace XamCore.PhotosUI {
#if !MONOMAC
[Mac (10,12, onlyOn64: true)]
[TV (10,0)]
[iOS (9,1)]
[Native]
@ -13,6 +14,14 @@ namespace XamCore.PhotosUI {
Hint
}
#if MONOMAC
[Mac (10,12, onlyOn64: true)]
[Native]
public enum PHLivePhotoViewContentMode : nint {
AspectFit,
AspectFill,
}
#else
[TV (10,0)]
[iOS (9,1)]
[Native]

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

@ -3,9 +3,15 @@ using XamCore.ObjCRuntime;
using XamCore.Foundation;
#if !MONOMAC
using XamCore.UIKit;
// ease compilation for [NoiOS] and [NoTV] decorated members
using NSView = XamCore.Foundation.NSObject;
using PHLivePhotoViewContentMode = XamCore.Foundation.NSObject;
#else
using XamCore.AppKit;
using UIImage = XamCore.AppKit.NSImage;
// ease compilation for [NoMac] decorated members
using UIGestureRecognizer = XamCore.Foundation.NSObject;
using PHLivePhotoBadgeOptions = XamCore.Foundation.NSObject;
#endif
using XamCore.Photos;
using System;
@ -44,16 +50,21 @@ namespace XamCore.PhotosUI {
bool ShouldShowCancelConfirmation { get; }
}
#if !MONOMAC
[TV (10,0)]
[iOS (9,1)]
[Mac (10,12, onlyOn64: true)]
#if MONOMAC
[BaseType (typeof (NSView))]
#else
[BaseType (typeof (UIView))]
#endif
interface PHLivePhotoView {
// inlined (designated initializer)
[Export ("initWithFrame:")]
IntPtr Constructor (CGRect frame);
[NoMac]
[Static]
[Export ("livePhotoBadgeImageWithOptions:")]
UIImage GetLivePhotoBadgeImage (PHLivePhotoBadgeOptions badgeOptions);
@ -69,6 +80,7 @@ namespace XamCore.PhotosUI {
[NullAllowed, Export ("livePhoto", ArgumentSemantic.Strong)]
PHLivePhoto LivePhoto { get; set; }
[NoMac]
[Export ("playbackGestureRecognizer", ArgumentSemantic.Strong)]
UIGestureRecognizer PlaybackGestureRecognizer { get; }
@ -80,10 +92,31 @@ namespace XamCore.PhotosUI {
[Export ("stopPlayback")]
void StopPlayback ();
[NoiOS]
[NoTV]
[Export ("stopPlaybackAnimated:")]
void StopPlayback (bool animated);
[NoiOS]
[NoTV]
[Export ("contentMode", ArgumentSemantic.Assign)]
PHLivePhotoViewContentMode ContentMode { get; set; }
[NoiOS]
[NoTV]
[Export ("audioVolume")]
float AudioVolume { get; set; }
[NoiOS]
[NoTV]
[NullAllowed, Export ("livePhotoBadgeView", ArgumentSemantic.Strong)]
NSView LivePhotoBadgeView { get; }
}
[TV (10,0)]
[iOS (9,1)][NoMac]
[iOS (9,1)]
[Mac (10,12)]
[Protocol, Model]
[BaseType (typeof (NSObject))]
interface PHLivePhotoViewDelegate {
@ -93,7 +126,6 @@ namespace XamCore.PhotosUI {
[Export ("livePhotoView:didEndPlaybackWithStyle:")]
void DidEndPlayback (PHLivePhotoView livePhotoView, PHLivePhotoViewPlaybackStyle playbackStyle);
}
#endif
[Mac (10,13, onlyOn64: true)][NoiOS][NoTV][NoWatch]
[Static]

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

@ -21,14 +21,16 @@ namespace Extrospection {
// e.g. WatchKit.WKErrorCode and WebKit.WKErrorCode :-(
if (!enums.TryGetValue (name, out var td))
enums.Add (name, type);
else if (td.Namespace.StartsWith ("OpenTK.", StringComparison.Ordinal)) {
// OpenTK duplicate a lots of enums between it's versions
} else if (type.IsNotPublic && String.IsNullOrEmpty (type.Namespace)) {
// ignore special, non exposed types
} else {
var sorted = Helpers.Sort (type, td);
var framework = Helpers.GetFramework (sorted.Item1);
Log.On (framework).Add ($"!duplicate-type-name! {name} enum exists as both {sorted.Item1.FullName} and {sorted.Item2.FullName}");
else {
var (t1, t2) = Helpers.Sort (type, td);
if (t1.Namespace.StartsWith ("OpenTK.", StringComparison.Ordinal)) {
// OpenTK duplicate a lots of enums between it's versions
} else if (t1.IsNotPublic && String.IsNullOrEmpty (t1.Namespace)) {
// ignore special, non exposed types
} else {
var framework = Helpers.GetFramework (t1);
Log.On (framework).Add ($"!duplicate-type-name! {name} enum exists as both {t1.FullName} and {t2.FullName}");
}
}
}

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

@ -1,17 +0,0 @@
!missing-enum! PHLivePhotoViewContentMode not bound
!missing-enum! PHLivePhotoViewPlaybackStyle not bound
!missing-protocol! PHLivePhotoViewDelegate not bound
!missing-selector! PHLivePhotoView::audioVolume not bound
!missing-selector! PHLivePhotoView::contentMode not bound
!missing-selector! PHLivePhotoView::delegate not bound
!missing-selector! PHLivePhotoView::isMuted not bound
!missing-selector! PHLivePhotoView::livePhoto not bound
!missing-selector! PHLivePhotoView::livePhotoBadgeView not bound
!missing-selector! PHLivePhotoView::setAudioVolume: not bound
!missing-selector! PHLivePhotoView::setContentMode: not bound
!missing-selector! PHLivePhotoView::setDelegate: not bound
!missing-selector! PHLivePhotoView::setLivePhoto: not bound
!missing-selector! PHLivePhotoView::setMuted: not bound
!missing-selector! PHLivePhotoView::startPlaybackWithStyle: not bound
!missing-selector! PHLivePhotoView::stopPlaybackAnimated: not bound
!missing-type! PHLivePhotoView not bound