Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
Add [Async] to the shared frameworks used by monotouch.
Browse files Browse the repository at this point in the history
  • Loading branch information
kumpera committed Mar 25, 2013
1 parent 2798390 commit 49deb34
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/avfoundation.cs
Expand Up @@ -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

This comment has been minimized.

Copy link
@migueldeicaza

migueldeicaza Mar 26, 2013

Contributor

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)]
Expand Down Expand Up @@ -1287,6 +1288,7 @@ interface AVAssetWriter {
#if !MONOMAC
[Since (6,0)]
[Export ("finishWritingWithCompletionHandler:")]
[Async]
void FinishWriting (NSAction completionHandler);
#endif
[Export ("movieTimeScale")]
Expand Down Expand Up @@ -2443,6 +2445,7 @@ interface AVMetadataItem {
AVKeyValueStatus StatusOfValueForKeyerror (string key, out NSError error);

[Export ("loadValuesAsynchronouslyForKeys:completionHandler:")]
[Async]
void LoadValuesAsynchronously (string [] keys, NSAction handler);

This comment has been minimized.

Copy link
@migueldeicaza

migueldeicaza Mar 26, 2013

Contributor

Same issue with this one

[Since (6,0)]
Expand Down Expand Up @@ -2709,6 +2712,7 @@ interface AVAssetExportSession {
IntPtr Constructor (AVAsset asset, string presetName);

[Export ("exportAsynchronouslyWithCompletionHandler:")]
[Async]
void ExportAsynchronously (AVCompletionHandler handler);

This comment has been minimized.

Copy link
@migueldeicaza

migueldeicaza Mar 26, 2013

Contributor

And this one


[Export ("cancelExport")]
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -3463,6 +3469,7 @@ interface AVCaptureStillImageOutput {
AVVideoSettingsCompressed CompressedVideoSetting { get; set; }

[Export ("captureStillImageAsynchronouslyFromConnection:completionHandler:")]
[Async]
void CaptureStillImageAsynchronously (AVCaptureConnection connection, AVCaptureCompletionHandler completionHandler);

This comment has been minimized.

Copy link
@migueldeicaza

migueldeicaza Mar 26, 2013

Contributor

And this one


[Static, Export ("jpegStillImageNSDataRepresentation:")]
Expand Down Expand Up @@ -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)]
Expand All @@ -3722,6 +3731,7 @@ interface AVPlayer {

[Since (6,0)]
[Export ("seekToDate:completionHandler:")]
[Async]
void Seek (NSDate date, AVCompletion onComplete);
#endif
[Since (6,0)]
Expand All @@ -3730,6 +3740,7 @@ interface AVPlayer {

[Since (6,0)]
[Export ("prerollAtRate:completionHandler:")]
[Async]
void Preroll (float rate, AVCompletion onComplete);

[Since (6,0)]
Expand Down Expand Up @@ -3966,6 +3977,7 @@ interface AVPlayerItem {

[Since (5,0)]
[Export ("seekToTime:completionHandler:")]
[Async]
void Seek (CMTime time, AVCompletion completion);

[Since (5,0)]
Expand All @@ -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)]
Expand Down Expand Up @@ -4023,6 +4036,7 @@ interface AVPlayerItem {
#if !MONOMAC
[Since (6,0)]
[Export ("seekToDate:completionHandler:")]
[Async]
bool Seek (NSDate date, AVCompletion completion);

[Since (6,0)]
Expand Down
1 change: 1 addition & 0 deletions src/coredata.cs
Expand Up @@ -650,6 +650,7 @@ public interface NSManagedObjectContext {
IntPtr Constructor (NSManagedObjectContextConcurrencyType ct);

[Export ("performBlock:")]
[Async]
void Perform (/* non null */ NSAction action);

[Export ("performBlockAndWait:")]
Expand Down
4 changes: 4 additions & 0 deletions src/corelocation.cs
Expand Up @@ -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")]
Expand Down
1 change: 1 addition & 0 deletions src/foundation.cs
Expand Up @@ -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
Expand Down

0 comments on commit 49deb34

Please sign in to comment.