1
/*****************************************************************************
2
* VLCMinimalVoutWindow.m: MacOS X Minimal interface window
3
*****************************************************************************
4
* Copyright (C) 2007 the VideoLAN team
7
* Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22
*****************************************************************************/
24
/*****************************************************************************
26
*****************************************************************************/
29
#include "VLCOpenGLVoutView.h"
30
#include "VLCMinimalVoutWindow.h"
32
/* SetSystemUIMode, ... */
33
#import <QuickTime/QuickTime.h>
35
#import <Cocoa/Cocoa.h>
37
@implementation VLCMinimalVoutWindow
38
- (id)initWithContentRect:(NSRect)contentRect
40
if( self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO])
42
initialFrame = contentRect;
44
[self setBackgroundColor:[NSColor blackColor]];
45
[self setHasShadow:YES];
46
[self setMovableByWindowBackground: YES];
52
/* @protocol VLCOpenGLVoutEmbedding */
53
- (void)addVoutSubview:(NSView *)view
55
[view setAutoresizingMask:NSViewHeightSizable|NSViewWidthSizable];
56
[[self contentView] addSubview:view];
57
[view setFrame:[[self contentView] bounds]];
60
- (void)removeVoutSubview:(NSView *)view
66
- (void)enterFullscreen
69
initialFrame = [self frame];
70
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
71
[self setFrame:[[self screen] frame] display:YES animate:YES];
74
- (void)leaveFullscreen
77
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
78
[self setFrame:initialFrame display:YES animate:YES];
81
- (BOOL)stretchesVideo
86
- (void)setOnTop: (BOOL)ontop