Permalink
Browse files

Add [Async] to the shared frameworks used by monotouch.

  • Loading branch information...
1 parent 2798390 commit 49deb343fa6a9b81f2f40f5267b8db857accbdfa @kumpera kumpera committed Mar 25, 2013
Showing with 20 additions and 0 deletions.
  1. +14 −0 src/avfoundation.cs
  2. +1 −0 src/coredata.cs
  3. +4 −0 src/corelocation.cs
  4. +1 −0 src/foundation.cs
View
@@ -962,6 +962,7 @@ interface AVAsset {
AVKeyValueStatus StatusOfValue (string key, out NSError error);
[Export ("loadValuesAsynchronouslyForKeys:completionHandler:")]
+ [Async]
void LoadValuesAsynchronously (string [] keys, NSAction handler);
#if !MONOMAC
@migueldeicaza
migueldeicaza Mar 26, 2013 Member

We are going to provide a different name, because this already has the name "Asynchorunsly"

The TAP has a suggestion for how to name the method, I think the extension should be TaskAsync or something like that.

This means that we need to make the [Async] attribute take a parameter to name the generated function name.

[Since (6,0)]
@@ -1287,6 +1288,7 @@ interface AVAssetWriter {
#if !MONOMAC
[Since (6,0)]
[Export ("finishWritingWithCompletionHandler:")]
+ [Async]
void FinishWriting (NSAction completionHandler);
#endif
[Export ("movieTimeScale")]
@@ -2443,6 +2445,7 @@ interface AVMetadataItem {
AVKeyValueStatus StatusOfValueForKeyerror (string key, out NSError error);
[Export ("loadValuesAsynchronouslyForKeys:completionHandler:")]
+ [Async]
void LoadValuesAsynchronously (string [] keys, NSAction handler);
@migueldeicaza
migueldeicaza Mar 26, 2013 Member

Same issue with this one

[Since (6,0)]
@@ -2709,6 +2712,7 @@ interface AVAssetExportSession {
IntPtr Constructor (AVAsset asset, string presetName);
[Export ("exportAsynchronouslyWithCompletionHandler:")]
+ [Async]
void ExportAsynchronously (AVCompletionHandler handler);
@migueldeicaza
migueldeicaza Mar 26, 2013 Member

And this one

[Export ("cancelExport")]
@@ -2750,10 +2754,12 @@ interface AVAssetExportSession {
#if !MONOMAC
[Since (6,0)]
[Static, Export ("determineCompatibilityOfExportPreset:withAsset:outputFileType:completionHandler:")]
+ [Async]
void DetermineCompatibilityOfExportPreset (string presetName, AVAsset asset, string outputFileType, Action<bool> isCompatibleResult);
[Since (6,0)]
[Export ("determineCompatibleFileTypesWithCompletionHandler:")]
+ [Async]
void DetermineCompatibleFileTypes (Action<string []> compatibleFileTypesHandler);
#endif
}
@@ -3463,6 +3469,7 @@ interface AVCaptureStillImageOutput {
AVVideoSettingsCompressed CompressedVideoSetting { get; set; }
[Export ("captureStillImageAsynchronouslyFromConnection:completionHandler:")]
+ [Async]
void CaptureStillImageAsynchronously (AVCaptureConnection connection, AVCaptureCompletionHandler completionHandler);
@migueldeicaza
migueldeicaza Mar 26, 2013 Member

And this one

[Static, Export ("jpegStillImageNSDataRepresentation:")]
@@ -3710,10 +3717,12 @@ interface AVPlayer {
#endif
[Since (5,0)]
[Export ("seekToTime:completionHandler:")]
+ [Async]
void Seek (CMTime time, AVCompletion completion);
[Since (5,0)]
[Export ("seekToTime:toleranceBefore:toleranceAfter:completionHandler:")]
+ [Async]
void Seek (CMTime time, CMTime toleranceBefore, CMTime toleranceAfter, AVCompletion completion);
#if !MONOMAC
[Since (6,0)]
@@ -3722,6 +3731,7 @@ interface AVPlayer {
[Since (6,0)]
[Export ("seekToDate:completionHandler:")]
+ [Async]
void Seek (NSDate date, AVCompletion onComplete);
#endif
[Since (6,0)]
@@ -3730,6 +3740,7 @@ interface AVPlayer {
[Since (6,0)]
[Export ("prerollAtRate:completionHandler:")]
+ [Async]
void Preroll (float rate, AVCompletion onComplete);
[Since (6,0)]
@@ -3966,6 +3977,7 @@ interface AVPlayerItem {
[Since (5,0)]
[Export ("seekToTime:completionHandler:")]
+ [Async]
void Seek (CMTime time, AVCompletion completion);
[Since (5,0)]
@@ -3974,6 +3986,7 @@ interface AVPlayerItem {
[Since (5,0)]
[Export ("seekToTime:toleranceBefore:toleranceAfter:completionHandler:")]
+ [Async]
void Seek (CMTime time, CMTime toleranceBefore, CMTime toleranceAfter, AVCompletion completion);
#if !MONOMAC
[Since (5,0)]
@@ -4023,6 +4036,7 @@ interface AVPlayerItem {
#if !MONOMAC
[Since (6,0)]
[Export ("seekToDate:completionHandler:")]
+ [Async]
bool Seek (NSDate date, AVCompletion completion);
[Since (6,0)]
View
@@ -650,6 +650,7 @@ public interface NSManagedObjectContext {
IntPtr Constructor (NSManagedObjectContextConcurrencyType ct);
[Export ("performBlock:")]
+ [Async]
void Perform (/* non null */ NSAction action);
[Export ("performBlockAndWait:")]
View
@@ -380,15 +380,19 @@ interface CLGeocoder {
bool Geocoding { get; }
[Export ("reverseGeocodeLocation:completionHandler:")]
+ [Async]
void ReverseGeocodeLocation (CLLocation location, CLGeocodeCompletionHandler completionHandler);
[Export ("geocodeAddressDictionary:completionHandler:")]
+ [Async]
void GeocodeAddress (NSDictionary addressDictionary, CLGeocodeCompletionHandler completionHandler);
[Export ("geocodeAddressString:completionHandler:")]
+ [Async]
void GeocodeAddress (string addressString, CLGeocodeCompletionHandler completionHandler);
[Export ("geocodeAddressString:inRegion:completionHandler:")]
+ [Async]
void GeocodeAddress (string addressString, CLRegion region, CLGeocodeCompletionHandler completionHandler);
[Export ("cancelGeocode")]
View
@@ -3062,6 +3062,7 @@ public interface NSUrlConnection {
[Since (5,0)]
[Static]
[Export ("sendAsynchronousRequest:queue:completionHandler:")]
+ [Async ("NSUrlAsyncResult")]
void SendAsynchronousRequest (NSUrlRequest request, NSOperationQueue queue, NSUrlConnectionDataResponse completionHandler);
#if !MONOMAC

0 comments on commit 49deb34

Please sign in to comment.