@@ -65,33 +65,6 @@ Display CreateDisplayFromMonitor(HMONITOR monitor, bool isMainScreen) {
6565
6666 return display;
6767}
68- DisplayManager::DisplayManager () {
69- // Constructor implementation
70- std::cout << " DisplayManager initialized" << std::endl;
71- }
72-
73- DisplayManager::~DisplayManager () {
74- // Destructor implementation
75- std::cout << " DisplayManager destroyed" << std::endl;
76- }
77-
78- Point DisplayManager::GetCursorScreenPoint () {
79- POINT cursorPos;
80- GetCursorPos (&cursorPos);
81-
82- Point point;
83- point.x = cursorPos.x ;
84- point.y = cursorPos.y ;
85- return point;
86- }
87-
88- Display DisplayManager::GetPrimaryDisplay () {
89- POINT ptZero = {0 , 0 };
90- HMONITOR monitor = MonitorFromPoint (ptZero, MONITOR_DEFAULTTOPRIMARY);
91- Display display = CreateDisplayFromMonitor (monitor, true );
92- display.id = " " ;
93- return display;
94- }
9568
9669BOOL CALLBACK MonitorRepresentationEnumProc (HMONITOR monitor,
9770 HDC hdc,
@@ -104,11 +77,28 @@ BOOL CALLBACK MonitorRepresentationEnumProc(HMONITOR monitor,
10477 return TRUE ;
10578}
10679
107- std::vector<Display> DisplayManager::GetAllDisplays () {
80+ std::vector<Display> DisplayManager::GetAll () {
10881 std::vector<Display> displayList;
10982 ::EnumDisplayMonitors (nullptr , nullptr , MonitorRepresentationEnumProc,
11083 reinterpret_cast <LPARAM>(&displayList));
11184 return displayList;
11285}
11386
87+ Display DisplayManager::GetPrimary () {
88+ POINT ptZero = {0 , 0 };
89+ HMONITOR monitor = MonitorFromPoint (ptZero, MONITOR_DEFAULTTOPRIMARY);
90+ Display display = CreateDisplayFromMonitor (monitor, true );
91+ display.id = " " ;
92+ return display;
93+ }
94+
95+ Point DisplayManager::GetCursorPosition () {
96+ POINT cursorPos;
97+ GetCursorPos (&cursorPos);
98+
99+ Point point;
100+ point.x = cursorPos.x ;
101+ point.y = cursorPos.y ;
102+ return point;
103+ }
114104} // namespace nativeapi
0 commit comments