diff options
Diffstat (limited to 'src/video_out/macosx/video_window.m')
| -rw-r--r-- | src/video_out/macosx/video_window.m | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/video_out/macosx/video_window.m b/src/video_out/macosx/video_window.m index 6546428a9..b70d9c0ce 100644 --- a/src/video_out/macosx/video_window.m +++ b/src/video_out/macosx/video_window.m @@ -31,6 +31,8 @@ NSString *XineViewDidResizeNotification = @"XineViewDidResizeNotification"; +#define DEFAULT_VIDEO_WINDOW_SIZE (NSMakeSize(320, 200)) + @implementation XineVideoWindow @@ -40,6 +42,30 @@ NSString *XineViewDidResizeNotification = @"XineViewDidResizeNotification"; [super setContentSize: size]; } +- (id) init +{ + return [self initWithContentSize:DEFAULT_VIDEO_WINDOW_SIZE]; +} + +- (id) initWithContentSize:(NSSize)size +{ + NSScreen *screen = [NSScreen mainScreen]; + NSSize screen_size = [screen frame].size; + + /* make a centered window */ + NSRect frame; + frame.size = size; + frame.origin.x = (screen_size.width - frame.size.width) / 2; + frame.origin.y = (screen_size.height - frame.size.height) / 2; + + unsigned int style_mask = NSTitledWindowMask | NSMiniaturizableWindowMask | + NSClosableWindowMask | NSResizableWindowMask; + + return ([self initWithContentRect:frame styleMask:style_mask + backing:NSBackingStoreBuffered defer:NO + screen:screen]); +} + - (id) initWithContentRect: (NSRect)rect styleMask:(unsigned int)styleMask backing:(NSBackingStoreType)bufferingType @@ -110,7 +136,7 @@ NSString *XineViewDidResizeNotification = @"XineViewDidResizeNotification"; keepAspectRatio = flag; } -- (int) keepsAspectRatio { +- (BOOL) keepsAspectRatio { return keepAspectRatio; } |
