Files
swift-mirror/stdlib/objc/QuartzCore/QuartzCore.swift
Chris Lattner 7a56499d61 Start making @objc not start with an @ sign:
- Change the parser to accept "objc" without an @ sign as a contextual
   keyword, including the dance to handle the general parenthesized case.
 - Update all comments to refer to "objc" instead of "@objc".
 - Update all diagnostics accordingly.
 - Update all tests that fail due to the diagnostics change.
 - Switch the stdlib to use the new syntax.

This does not switch all tests to use the new syntax, nor does it warn about
the old syntax yet.  That will be forthcoming.  Also, this needs a bit of 
refactoring, which will be coming up.



Swift SVN r19555
2014-07-04 05:57:57 +00:00

56 lines
1.8 KiB
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
import Foundation
@exported import QuartzCore // Clang module
// sdk overlays:
extension CIFilter {
// - (CIImage *)apply:(CIKernel *)k, ...
// objc(apply:arguments:options:)
// func apply(k: CIKernel!,
// arguments args: [AnyObject]!,
// options dict: Dictionary<NSObject, AnyObject>!) -> CIImage!
func apply(k: CIKernel!, args: [AnyObject]!, options: (NSCopying, AnyObject)...) -> CIImage {
var dict = NSMutableDictionary()
for (key, value) in options {
dict[key] = value
}
return self.apply(k, arguments: args, options: dict)
}
convenience init(name: String!,
elements: (NSCopying, AnyObject)...) {
var dict = NSMutableDictionary()
for (key, value) in elements {
dict[key] = value
}
self.init(name: name, withInputParameters: dict)
}
}
// sdk overlays:
extension CISampler {
// - (id)initWithImage:(CIImage *)im keysAndValues:key0, ...;
convenience init(im: CIImage!, elements: (NSCopying, AnyObject)...) {
var dict = NSMutableDictionary()
for (key, value) in elements {
dict[key] = value
}
// objc(initWithImage:options:)
// init(image im: CIImage!,
// options dict: NSDictionary!)
self.init(image: im, options: dict)
}
}