File tree Expand file tree Collapse file tree 5 files changed +49
-0
lines changed
Expand file tree Collapse file tree 5 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ .build /
2+ .swift-version
Original file line number Diff line number Diff line change 1+ [submodule "Sources/libnativeapi "]
2+ path = Sources/libnativeapi
3+ url = https://github.com/leanflutter/libnativeapi.git
Original file line number Diff line number Diff line change 1+ // swift-tools-version:6.0
2+ import PackageDescription
3+
4+ let package = Package (
5+ name: " nativeapi " ,
6+ targets: [
7+ . executableTarget(
8+ name: " Example " ,
9+ dependencies: [ " libnativeapi " ] ,
10+ swiftSettings: [
11+ . interoperabilityMode( . Cxx)
12+ ]
13+ ) ,
14+ . target(
15+ name: " libnativeapi " ,
16+ exclude: [
17+ " examples " ,
18+ " src/screen_retriever_linux.cpp " ,
19+ " src/screen_retriever_linux.h " ,
20+ " src/screen_retriever_windows.cpp " ,
21+ " src/screen_retriever_windows.h " ,
22+ ] ,
23+ linkerSettings: [
24+ . linkedFramework( " Cocoa " ) ,
25+ . linkedFramework( " Foundation " )
26+ ]
27+ ) ,
28+ ] ,
29+ cxxLanguageStandard: . cxx17
30+ )
Original file line number Diff line number Diff line change 1+ import libnativeapi
2+
3+ var screenRetriever = ScreenRetrieverMacOS ( )
4+ let cursorPoint = screenRetriever. GetCursorScreenPoint ( )
5+ let primaryDisplay = screenRetriever. GetPrimaryDisplay ( )
6+ let allDisplays = screenRetriever. GetAllDisplays ( )
7+
8+ print ( cursorPoint)
9+ print ( primaryDisplay)
10+ print ( allDisplays)
11+
12+ print ( String ( cString: primaryDisplay. id) )
13+ print ( String ( cString: primaryDisplay. name) )
You can’t perform that action at this time.
0 commit comments