Skip to content

Commit 3c6b4d5

Browse files
committed
modify Example to use DisplayManager instead of ScreenRetriever, and update submodule reference for libnativeapi.
1 parent 1d2aaa2 commit 3c6b4d5

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ let package = Package(
1616
path: "Sources/libnativeapi",
1717
exclude: [
1818
"examples",
19-
"src/screen_retriever_linux.cpp",
20-
"src/screen_retriever_windows.cpp",
19+
"src/display_manager_linux.cpp",
20+
"src/display_manager_windows.cpp",
2121
],
2222
linkerSettings: [
2323
.linkedFramework("Cocoa"),

Sources/Example/main.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import nativeapi
22

3-
var screenRetriever = nativeapi.ScreenRetriever()
4-
let cursorPoint = screenRetriever.GetCursorScreenPoint()
5-
let primaryDisplay = screenRetriever.GetPrimaryDisplay()
6-
let allDisplays = screenRetriever.GetAllDisplays()
3+
var displayManager = nativeapi.DisplayManager()
4+
let allDisplays = displayManager.GetAll()
5+
let primaryDisplay = displayManager.GetPrimary()
6+
let cursorPosition = displayManager.GetCursorPosition()
77

8-
print(cursorPoint)
8+
print(cursorPosition)
99
print(primaryDisplay)
1010
print(allDisplays)
1111

12-
print(primaryDisplay.id)
13-
print(primaryDisplay.name)
12+
print(primaryDisplay.width)
13+
print(primaryDisplay.height)

Sources/libnativeapi

0 commit comments

Comments
 (0)