Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add #if os(macOS) macro #64

Merged
merged 1 commit into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Lib/Sauce/InputSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Copyright © 2015-2020 Clipy Project.
//

#if os(macOS)
import Foundation
import Carbon

Expand Down Expand Up @@ -56,3 +57,4 @@ extension InputSource: Equatable {
lhs.modeID == rhs.modeID
}
}
#endif
2 changes: 2 additions & 0 deletions Lib/Sauce/Key.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Copyright © 2015-2020 Clipy Project.
//

#if os(macOS)
import Foundation
import Carbon

Expand Down Expand Up @@ -561,3 +562,4 @@ public enum Key: String, Codable, Equatable {
}

}
#endif
2 changes: 2 additions & 0 deletions Lib/Sauce/KeyboardLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Copyright © 2015-2020 Clipy Project.
//

#if os(macOS)
import Foundation
import Carbon

Expand Down Expand Up @@ -186,3 +187,4 @@ private extension KeyboardLayout {
return NSString(characters: &chars, length: length) as String
}
}
#endif
2 changes: 2 additions & 0 deletions Lib/Sauce/ModifierTransformer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Copyright © 2015-2020 Clipy Project.
//

#if os(macOS)
import Foundation
import Carbon
import AppKit
Expand Down Expand Up @@ -44,3 +45,4 @@ extension ModifierTransformer {
return convertedCarbonModifiers
}
}
#endif
2 changes: 2 additions & 0 deletions Lib/Sauce/NSMenuItem+Key.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Copyright © 2015-2020 Clipy Project.
//

#if os(macOS)
import AppKit

extension NSMenuItem {
Expand All @@ -21,3 +22,4 @@ extension NSMenuItem {
return Key(character: keyEquivalent, virtualKeyCode: nil)
}
}
#endif
2 changes: 2 additions & 0 deletions Lib/Sauce/Sauce.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Copyright © 2015-2020 Clipy Project.
//

#if os(macOS)
import Foundation
import AppKit

Expand Down Expand Up @@ -112,3 +113,4 @@ extension Sauce {
return character(with: source, keyCode: keyCode, carbonModifiers: modifierTransformar.carbonFlags(from: cocoaModifiers))
}
}
#endif
2 changes: 2 additions & 0 deletions Lib/Sauce/SpecialKeyCode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Copyright © 2015-2020 Clipy Project.
//

#if os(macOS)
import Foundation
import Carbon

Expand Down Expand Up @@ -157,3 +158,4 @@ private extension Int {
return String(format: "%C", self)
}
}
#endif
2 changes: 2 additions & 0 deletions Lib/Sauce/TISInputSource+Property.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Copyright © 2015-2020 Clipy Project.
//

#if os(macOS)
import Foundation
import Carbon

Expand All @@ -17,3 +18,4 @@ extension TISInputSource {
return Unmanaged<AnyObject>.fromOpaque(value).takeUnretainedValue() as? T
}
}
#endif