Commit Graph

185 Commits

Author SHA1 Message Date
Michael Ilseman
654c5235fe [CoreGraphics] fix up a few inconsistent names (#3912)
* [CoreGraphics] fix up a few inconsistent names

* [test] Remove LLVM value names to pass no-assert builds
2016-08-01 20:53:10 -07:00
Maxim Moiseev
36d2f26175 [overlay] GameplayKit apinotes 2016-07-31 12:13:39 +03:00
Maxim Moiseev
a99221bfde [overlay] CryptoTokenKit (#3859)
This is work in progress
2016-07-29 12:39:37 -07:00
Jacob Bandes-Storch
3f9103f541 [apinotes] Rename NSApplication activateIgnoringOtherApps(_:) to activate(ignoringOtherApps:) (#3774) 2016-07-28 22:22:05 -07:00
Jordan Rose
b712f0ef11 [APINotes] One more 0-valued option set case. (#3805)
rdar://problem/27482020
2016-07-28 16:00:13 -07:00
Tony Parker
3331dc4399 Merge pull request #3610 from phausler/ByteCountFormatter_naming_updates
[Foundation] Update ByteCountFormatter to have a uniform apinotes ann…
2016-07-26 11:02:11 -07:00
Tony Parker
a0470750bb Merge pull request #3609 from phausler/CharacterSet_naming_changes
[Foundation] Update CharacterSet and NSCharacterSet punctuationCharac…
2016-07-26 09:41:47 -07:00
swift-ci
c41edb8c94 Merge pull request #3670 from parkera/rename_task_to_process 2016-07-25 20:50:20 -07:00
swift-ci
00934a74eb Merge pull request #3667 from parkera/rename_nsoutputstream 2016-07-24 13:59:07 -07:00
Maxim Moiseev
8c3b943634 [overlay] Fix PictureInPicture method names with apinotes (#3674) 2016-07-22 10:38:58 -07:00
Tony Parker
be316f5035 Rename NSTask to Process 2016-07-21 15:23:12 -07:00
swift-ci
1142318eaf Merge pull request #3663 from parkera/nscoder_encodeint 2016-07-21 15:04:01 -07:00
Tony Parker
cecc463bd0 Rename NSOutputStream to OutputStream 2016-07-21 14:06:15 -07:00
Maxim Moiseev
c7facf12b2 [overlay] NSBezierPath.flattened and .reversed (#3622)
* [overlay] NSBezierPath.flattened and .reversed

* fixing the test
2016-07-21 12:47:07 -07:00
Tony Parker
6d9515daeb <rdar://problem/27425997> NSCoder encodeInt:forKey cannot be overridden in Swift, throws runtime exception 2016-07-21 11:29:31 -07:00
Maxim Moiseev
557f7eb627 [overlay] Fix AppKit NSAccessibility notifications type (Notification.Name -> String) (#3636) 2016-07-21 11:01:33 -07:00
Doug Gregor
2d7847d7b7 Merge pull request #3648 from mwwa/libdispatch-data-fixes
[libdispatch] libdispatch data fixes
2016-07-20 22:22:02 -07:00
Matt Wright
56a579763f [libdispatch-data-fixes] Appending UnsafeBufferPointers to data is unsafe
* The buffer-pointer based init methods were passing the dispatch
    data default destructor in such a way that the
    @convention(block)-ness was lost. This leads to a thunk being passed
    to dispatch instead of NULL. Subsequently, dispatch would reference
    rather than copy the provided data.

    Fixes:
	SR-2050 (<rdar://problem/27293973>)
2016-07-20 16:46:31 -07:00
Maxim Moiseev
c2e3369968 Photos overlay (#3613) 2016-07-20 15:01:46 -07:00
Luke Larson
74e0498015 Revert "Update master to build with Xcode 8 beta 3, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs."
This reverts commit 62d1fa760c.
2016-07-19 15:18:17 -07:00
Mishal Shah
62d1fa760c Update master to build with Xcode 8 beta 3, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-07-19 22:31:34 +02:00
Philippe Hausler
83e7dbbafc [Foundation] Update ByteCountFormatter to have a uniform apinotes annotation for stringFromByteCount:
rdar://problem/26481720 NSByteCountFormatter naming inconsistency
2016-07-19 11:11:11 -07:00
Philippe Hausler
e9cae7be79 [Foundation] Update CharacterSet and NSCharacterSet punctuationCharacters to more consistent naming
Addresses rdar://problem/26628434 Swift3: "whitespaces"?
2016-07-19 11:09:35 -07:00
Matt Wright
8ac413a0b5 [libdispatch] Post-beta API changes and bug fixes
* Fix DispatchSourceSignal initialisation such that it no longer
    registers for the wrong source type.

    * Remove (group:) option from DispatchWorkItem, introduce group
    options to `.async` methods that accept DispatchWorkItem.

    * Rename `DispatchSourceType` to `DispatchSourceProtocol`

    * Rework DispatchQueue attributes and flags into a less confusing
    approach.

    * Fixes:

	SR-1817, SR-1771, SR-1770, SR-1769

	<rdar://problem/26725156> <rdar://problem/26873917>
	<rdar://problem/26918843> <rdar://problem/26810149>
	<rdar://problem/27117023> <rdar://problem/27121422>
	<rdar://problem/27236887> <rdar://problem/27337555>
2016-07-18 13:22:23 -07:00
Tony Parker
8e814ac875 New value types for Calendar, TimeZone, and Locale
As part of the extensive work on value types in Foundation this year, we
decided to also add value types for these three key classes. In addition
to adding value semantics, the API was extensively audited to improve
Swift interop (especially Calendar).

rdar://26628184
2016-07-17 09:42:37 -07:00
Andrew Trick
888ff1ae99 Revert "New value types for Calendar, TimeZone, and Locale"
This reverts commit 46a9f57329.

This broke Swift CI, OSS incremental RA:

./swift/stdlib/public/SDK/Foundation/TimeZone.swift:228:45: error: 'NSTimeZone' is not implicitly convertible to 'TimeZone'; did you mean to use 'as' to explicitly convert?
        return lhs._wrapped.isEqual(to: rhs._wrapped)
2016-07-16 18:34:32 -07:00
Tony Parker
46a9f57329 New value types for Calendar, TimeZone, and Locale
As part of the extensive work on value types in Foundation this year, we
decided to also add value types for these three key classes. In addition
to adding value semantics, the API was extensively audited to improve
Swift interop (especially Calendar).

rdar://26628184
2016-07-16 17:58:27 -07:00
Andrew Trick
7b5723b9a5 Revert "New value types for Calendar, TimeZone, and Locale"
This reverts commit 9c1f21bdf0.

This breaks swift-ci for everyone:

stdlib/public/SDK/Foundation/Calendar.swift:426:74: error: 'DateInterval' is only available on iOS 10.0 or newer
    public func dateInterval(of component: Component, for date: Date) -> DateInterval? {
2016-07-16 17:08:06 -07:00
Tony Parker
9c1f21bdf0 New value types for Calendar, TimeZone, and Locale
As part of the extensive work on value types in Foundation this year, we
decided to also add value types for these three key classes. In addition
to adding value semantics, the API was extensively audited to improve
Swift interop (especially Calendar).

rdar://26628184
2016-07-16 15:48:08 -07:00
Philippe Hausler
e0ca8fbd80 [Foundation] Keep NS Updates due to changes in SE-0086
Second pass at updates for SE-0086 feedback

<rdar://problem/26892977> Make sure NSOrderedSet keeps its NS
<rdar://problem/26880016> NSBundleResourceRequest should keep its NS
<rdar://problem/26892958> Make sure NSAttributedString keeps its NS
<rdar://problem/26653694> NSCoder.decodeTopLevelObjectForKey does not follow naming guidelines
<rdar://problem/27355801> Foundation should have a structural type for TextCheckingResult
<rdar://problem/26770611> NSExpression naming is a bit awkward in swift
<rdar://problem/26653451> NSCoder encodeDataObject is misleading
<rdar://problem/26653653> NSCoder decodeObjectOfClass is redundant
2016-07-15 09:56:21 -07:00
Michael Ilseman
2b3a7a2306 Merge pull request #3516 from milseman/coregraphics
[Core Graphics] Rename several APIs to be more Swifty and consistent
2016-07-15 05:34:18 -07:00
Michael Ilseman
67e58f0c47 [Core Graphics] Rename several APIs to be more Swifty and consistent
This renames several APIs off of CGAffineTransform, CGPoint, CGSize,
CGColor, CGContext, CGRect, and CGColorSpace to have more consistent
names and Swifty names, in accordance with the Swift API Design
Guidelines.

At the same time, we drop many of the special mutating variants from
the overlays, as they are not typical CG usage and a historical
artifact. Test cases added for each.
2016-07-14 13:53:08 -07:00
Maxim Moiseev
4d2a477cce [overlay] Making Metal options with value 0 available (#3473)
Fixes: <rdar://problem/27270578>
2016-07-14 12:42:33 -07:00
Jordan Rose
1af013337d [API notes] One more zero-valued option set entry for UIKit. (#3499)
rdar://problem/27115143
2016-07-13 17:02:23 -07:00
Doug Gregor
00bb9d1037 [SE-0112] Associate various error-code enums with their error domains in the SDK. 2016-07-13 11:15:01 -07:00
Doug Gregor
cb8ec8714a [SE-0112] Add typed accessors for various error types and keys.
Introduce typed accesses for the error types of AVFoundation,
CloudKit, Contacts, and CoreLocation. While here, fix the API notes
for the Contacts framework, which had an embarrassingly-wrong file
name ;)
2016-07-12 19:41:52 -07:00
Tony Parker
35dd2462f4 Naming updates and hoists for SE-0086
XMLNodeOptions -> XMLNode.Options
NSTextCheckingTypes -> hoisted into NSTextCheckingResult
URLSessionTaskMetricsResourceFetchType ->
URLSessionTaskMetrics.ResourceFetchType

27235689
26995110
2016-07-12 18:08:39 -07:00
Tony Parker
d39ad943d4 Some class methods became properties, which invalidated their apinotes fixes.
This change makes them regain their fixed names.

<rdar://problem/27301651> Renaming changes resulted in notANumber becoming notA
2016-07-12 17:22:18 -07:00
Doug Gregor
823c24b355 [SE-0112] Rename ErrorProtocol to Error.
This is bullet (5) of the proposed solution in SE-0112, and the last
major piece to be implemented.
2016-07-12 10:53:52 -07:00
Doug Gregor
ca4a32b5a9 [SE-0112] Bridge NSError to ErrorProtocol.
Introduce bridging of NSError to ErrorProtocol, so an Objective-C API
expressed via an "NSError *" will be imported using ErrorProtocol in
the Swift. For example, the Objective-C method:

  - (void)handleError:(NSError *)error userInteractionPermitted:(BOOL)userInteractionPermitted;

will now be imported as:

  func handleError(_ error: ErrorProtocol, userInteractionPermitted: Bool)

This is bullet (3) under the proposed solution of SE-0112. Note that
we made one semantic change here: instead of removing the conformance
of NSError to ErrorProtocol, which caused numerous problems both
theoretical and actual because the model expects that an NSError
conforms to ErrorProtocol without requiring wrapping, we instead limit
the ErrorProtocol -> NSError conversion that would be implied by
bridging. This is defensible in the short term because it also
eliminates the implicit conversion, and aligns with SE-0072, which
eliminates implicit bridging conversions altogether.
2016-07-12 10:53:52 -07:00
Michael Ilseman
6cdbacca9d Merge pull request #3420 from milseman/scenekit
[SceneKit] Add apinotes to swift_private some decls
2016-07-08 23:30:33 -07:00
Max Moiseev
29d7e66493 CallKit overlay with apinotes 2016-07-08 15:43:06 -07:00
Michael Ilseman
cd9b480103 [SceneKit] Add apinotes to swift_private some decls
These apinotes will swift_private many of the bounding box methods,
and adjust the overlays appropriately. Those APIs have better
alternatives provided by the overlays, and thus shouldln't be exposed.
2016-07-08 14:37:16 -07:00
Jordan Rose
df0ffb0a78 [APINotes] Update option set 0 case for Metal
MTLTextureUsage.unknown isn't really the same as an empty set;
the framework treats it as potentially /any/ usage.

rdar://problem/27115045
2016-07-06 12:42:52 -07:00
Jordan Rose
75a4583f39 [APINotes] Update enum case name for AVFoundation
rdar://problem/27115392
2016-07-06 12:42:52 -07:00
Mishal Shah
23b646eed2 Update master to build with Xcode 8 beta 2, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs 2016-07-06 10:48:45 -07:00
Doug Gregor
71882c6516 [API Notes] Use API notes rather than overlays to make error enums bridge.
The Clang attribute allows one to state that a particular enumeration
type describes an error, and associates it with a particular domain
constant. However, due to lack of API notes support, this attribute
wasn't actually getting used. Instead, we had a number of explicit
extensions to enum types to make them conform to the _BridgedNSError
protocol explicitly.

Now that we have API notes, use them to make these enums into error
enums with the appropriate domain, so that the Clang importer will
synthesize the _BridgedNSError conformances. Then, remove all of the
explicit conformances---and with them, the overlays for 12 frameworks.

There is a small fix to more eagerly consider these conformances as
"used" if an expression is formed with the error enum as a value
type. This better ensures that the conformances will be available at
runtime when needed.

This cleanup is needed to implement SE-0112 (NSError bridging),
although it is useful by itself.
2016-07-06 09:54:59 -07:00
Philippe Hausler
5947b75d17 [Foundation] The hoisted type for EnumerationOptions should be rooted in NSAttributedString not AttributedString 2016-07-05 13:14:30 -07:00
Philippe Hausler
24ff368d4f [Foundation] Swift3 API naming feedback
Addresses the following issues:

rdar://problem/25992816 -[NSUserDefaults registerDefaults] is being imported as NSUserDefaults.register(), which is confusing
rdar://problem/26291437 UserDefaults has 'setURL(forKey:)' instead of 'set(_:forKey:)'
rdar://problem/26375229 FileManager overlay has old naming
rdar://problem/26090891 NSBundle methods that are overridden in the apinotes incorrectly handle the first argument pattern
rdar://problem/26271340 struct URL initializer for fileURLWithFileSystemRepresentation is incorrectly named'
rdar://problem/26443640 XMLDTDNode.Kind conflicts with XMLNode.Kind and should be renamed to XMLDTDNode.DTDKind
rdar://problem/26500390 registerUndoWithTarget in overlay not updated for new API names
rdar://problem/26653451 NSCoder encodeDataObject is misleading
rdar://problem/26653653 NSCoder decodeObjectOfClass is redundant
rdar://problem/26653694 NSCoder.decodeTopLevelObjectForKey does not follow naming guidelines
rdar://problem/26656299 SocketNativeHandle should be a hoisted type to SocketPort
https://bugs.swift.org/browse/SR-1903
2016-07-05 11:19:12 -07:00
Jordan Rose
e8c1ad3959 [APINotes] NSPointerFunctionsOptions 0-valued members shouldn't be [].
.strongMemory and .objectPersonality happen to be the default settings
in their respective subgroups, but that doesn't mean they should be
omitted from the option set.
2016-06-30 15:01:16 -07:00