Skip to content

Commit ea4cd41

Browse files
committed
Add cross-platform display and tray icon APIs
- Implement Display, DisplayManager, Menu, TrayIcon, and TrayManager - Refactor window and display management for consistency - Add comprehensive README and example usage - Update Package.swift for new submodule and platform exclusions - Replace libnativeapi submodule with CNativeAPI - Add unit tests for AppRunner and Menu functionality
1 parent 7ac846c commit ea4cd41

File tree

15 files changed

+2917
-70
lines changed

15 files changed

+2917
-70
lines changed

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "Sources/libnativeapi"]
2-
path = Sources/libnativeapi
3-
url = https://github.com/libnativeapi/libnativeapi.git
1+
[submodule "Sources/CNativeAPI"]
2+
path = Sources/CNativeAPI
3+
url = https://github.com/libnativeapi/nativeapi.git

Package.swift

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,25 @@ let package = Package(
2121
),
2222
.target(
2323
name: "CNativeAPI",
24-
path: "Sources/libnativeapi",
24+
path: "Sources/CNativeAPI",
2525
exclude: {
26-
var excluded = ["examples"]
26+
var excluded = [
27+
"examples",
28+
"src/platform/linux",
29+
"src/platform/macos",
30+
"src/platform/windows",
31+
]
2732
#if os(Linux)
28-
excluded.append(contentsOf: ["src/platform/macos", "src/platform/windows"])
33+
excluded.removeAll { $0 == "src/platform/linux" }
2934
#elseif os(macOS)
30-
excluded.append(contentsOf: ["src/platform/linux", "src/platform/windows"])
35+
excluded.removeAll { $0 == "src/platform/macos" }
3136
#elseif os(Windows)
32-
excluded.append(contentsOf: ["src/platform/macos", "src/platform/linux"])
37+
excluded.removeAll { $0 == "src/platform/windows" }
3338
#endif
3439
return excluded
3540
}(),
3641
linkerSettings: {
37-
#if os(macOS) || os(iOS)
42+
#if os(macOS)
3843
return [
3944
.linkedFramework("Cocoa"),
4045
.linkedFramework("Foundation"),

0 commit comments

Comments
 (0)