* set svn:keywords correctly and fixed some minor stuff here and there
[vlc.git] / modules / gui / minimal_macosx / VLCMinimalVoutWindow.m
1 /*****************************************************************************
2  * VLCMinimalVoutWindow.m: MacOS X Minimal interface window
3  *****************************************************************************
4  * Copyright (C) 2007 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include "intf.h"
28 #include "voutgl.h"
29 #include "VLCOpenGLVoutView.h"
30 #include "VLCMinimalVoutWindow.h"
31
32 /* SetSystemUIMode, ... */
33 #import <QuickTime/QuickTime.h>
34
35 #import <Cocoa/Cocoa.h>
36
37 @implementation VLCMinimalVoutWindow
38 - (id)initWithContentRect:(NSRect)contentRect
39 {
40     if( self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO])
41     {
42         initialFrame = contentRect;
43         fullscreen = NO;
44         [self setBackgroundColor:[NSColor blackColor]];
45         [self setHasShadow:YES];
46         [self setMovableByWindowBackground: YES];
47         [self center];
48     }
49     return self;
50 }
51
52 /* @protocol VLCOpenGLVoutEmbedding */
53 - (void)addVoutSubview:(NSView *)view
54 {
55     [view setAutoresizingMask:NSViewHeightSizable|NSViewWidthSizable];
56     [[self contentView] addSubview:view];
57     [view setFrame:[[self contentView] bounds]];
58 }
59
60 - (void)removeVoutSubview:(NSView *)view
61 {
62     [self close];
63     [self release];
64 }
65
66 - (void)enterFullscreen
67 {
68     fullscreen = YES;
69     initialFrame = [self frame];
70     SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
71     [self setFrame:[[self screen] frame] display:YES animate:YES];
72 }
73
74 - (void)leaveFullscreen
75 {
76     fullscreen = NO;
77     SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
78     [self setFrame:initialFrame display:YES animate:YES];
79 }
80
81 - (BOOL)stretchesVideo
82 {
83     return NO;
84 }
85
86 - (void)setOnTop: (BOOL)ontop
87 {
88
89 }
90 @end
91