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

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

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

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

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