2015-12-30 06:41:46 +00:00
|
|
|
#if defined(Hiro_Monitor)
|
2014-01-05 09:59:17 +00:00
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
namespace hiro {
|
|
|
|
|
|
|
|
auto pMonitor::count() -> uint {
|
2014-01-05 09:59:17 +00:00
|
|
|
@autoreleasepool {
|
|
|
|
return [[NSScreen screens] count];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
auto pMonitor::geometry(uint monitor) -> Geometry {
|
2014-01-05 09:59:17 +00:00
|
|
|
@autoreleasepool {
|
|
|
|
NSRect rectangle = [[[NSScreen screens] objectAtIndex:monitor] frame];
|
2015-12-30 06:41:46 +00:00
|
|
|
return {(int)rectangle.origin.x, (int)rectangle.origin.y, (int)rectangle.size.width, (int)rectangle.size.height};
|
2014-01-05 09:59:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
auto pMonitor::primary() -> uint {
|
2014-01-05 09:59:17 +00:00
|
|
|
//on OS X, the primary monitor is always the first monitor
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2015-12-30 06:41:46 +00:00
|
|
|
|
|
|
|
#endif
|