-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented Swift object unwrapping.
- Loading branch information
1 parent
85d3ab8
commit 8454295
Showing
11 changed files
with
148 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,5 @@ | |
|
||
#include "WinRT.h" | ||
#include "IBufferByteAccess.h" | ||
#include "ISwiftObject.h" | ||
|
||
#include "Functions.h" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import COM | ||
|
||
/// Base for classes exported to WinRT. | ||
open class WinRTExportedObject<Projection: WinRTTwoWayProjection> | ||
: COMExportedObject<Projection>, IInspectableProtocol { | ||
public override func _queryInterfacePointer(_ id: COMInterfaceID) throws -> IUnknownPointer { | ||
return id == IInspectableProjection.id | ||
? identity.unknown.addingRef() | ||
: try super._queryInterfacePointer(id) | ||
} | ||
open class WinRTExport<Projection: WinRTTwoWayProjection> | ||
: COMExport<Projection>, IInspectableProtocol { | ||
open class var _runtimeClassName: String { String(describing: Self.self) } | ||
open class var _trustLevel: TrustLevel { .base } | ||
|
||
public final func getIids() throws -> [COMInterfaceID] { queriableInterfaces.map { $0.id } } | ||
open func getRuntimeClassName() throws -> String { try (implementation as! IInspectable).getRuntimeClassName() } | ||
open func getTrustLevel() throws -> TrustLevel { try (implementation as! IInspectable).getTrustLevel() } | ||
} | ||
public override func _createCOMObject() -> COMExportedObject<Projection> { | ||
WinRTExportedObject<Projection>( | ||
implementation: self as! Projection.SwiftObject, | ||
queriableInterfaces: Self.queriableInterfaces) | ||
} | ||
|
||
public final func getIids() throws -> [COMInterfaceID] { Self.queriableInterfaces.map { $0.id } } | ||
public final func getRuntimeClassName() throws -> String { Self._runtimeClassName } | ||
public final func getTrustLevel() throws -> TrustLevel { Self._trustLevel } | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.