File: monitor.cpp

package info (click to toggle)
higan 106-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 9,640 kB
  • sloc: cpp: 108,736; ansic: 809; makefile: 22; sh: 7
file content (28 lines) | stat: -rw-r--r-- 637 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#if defined(Hiro_Monitor)

namespace hiro {

auto pMonitor::count() -> uint {
  return QApplication::desktop()->screenCount();
}

auto pMonitor::dpi(uint monitor) -> Position {
  //Qt does not support per-monitor DPI retrieval
  return {
    QApplication::desktop()->logicalDpiX(),
    QApplication::desktop()->logicalDpiY()
  };
}

auto pMonitor::geometry(uint monitor) -> Geometry {
  QRect rectangle = QApplication::desktop()->screenGeometry(monitor);
  return {rectangle.x(), rectangle.y(), rectangle.width(), rectangle.height()};
}

auto pMonitor::primary() -> uint {
  return QApplication::desktop()->primaryScreen();
}

}

#endif