Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_SystemCocoa.mm
| Context not available. | |||||
| return count; | return count; | ||||
| } | } | ||||
| static NSRect contentRectForScreen(NSScreen *screen) | |||||
| void GHOST_SystemCocoa::getMainDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const | |||||
| { | { | ||||
| NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |||||
| //Get visible frame, that is frame excluding dock and top menu bar | //Get visible frame, that is frame excluding dock and top menu bar | ||||
| NSRect frame = [[NSScreen mainScreen] visibleFrame]; | NSRect frame = [[NSScreen mainScreen] visibleFrame]; | ||||
| //Returns max window contents (excluding title bar...) | // Returns max window contents (excluding title bar...) | ||||
| NSRect contentRect = [NSWindow contentRectForFrameRect:frame | NSRect contentRect = [NSWindow contentRectForFrameRect:frame | ||||
| styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask)]; | styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask)]; | ||||
| return contentRect; | |||||
| } | |||||
| void GHOST_SystemCocoa::getDisplayDimensions( | |||||
| GHOST_TUns32& x, GHOST_TUns32& y, | |||||
| GHOST_TUns32& width, GHOST_TUns32& height, GHOST_TUns8 num) const | |||||
| { | |||||
| NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |||||
| NSArray *screens = [NSScreen screens]; | |||||
| if (num < [screens length]) { | |||||
| NSScreen *screen = [screens objectAtIndex:num]; | |||||
| NSRect contentRect = [self contentRectForScreen:screen]; | |||||
| width = contentRect.size.width; | |||||
| height = contentRect.size.height; | |||||
| x = contentRect.origin.x; | |||||
| y = contentRect.origin.y; | |||||
| } | |||||
| [pool drain]; | |||||
| } | |||||
| void GHOST_SystemCocoa::getMainDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const | |||||
| { | |||||
| NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |||||
| NSRect contentRect = contentRectForScreen([NSScreen mainscreen]); | |||||
| width = contentRect.size.width; | width = contentRect.size.width; | ||||
| height = contentRect.size.height; | height = contentRect.size.height; | ||||
| Context not available. | |||||