v4l: support libv4l
[vlc/solaris.git] / modules / gui / minimal_macosx / VLCMinimalVoutWindow.m
blobf3357e0adc43d90c602cd45d74481a054a9a2f8c
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  *****************************************************************************/
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include "intf.h"
28 #include "voutgl.h"
29 #include "VLCOpenGLVoutView.h"
30 #include "VLCMinimalVoutWindow.h"
32 #import <Cocoa/Cocoa.h>
34 /* SetSystemUIMode, ... */
35 #import <Carbon/Carbon.h>
37 @implementation VLCMinimalVoutWindow
38 - (id)initWithContentRect:(NSRect)contentRect
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;
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
62     [self close];
63     [self release];
66 - (void)enterFullscreen
68     fullscreen = YES;
69     initialFrame = [self frame];
70     SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
71     [self setFrame:[[self screen] frame] display:YES animate:YES];
74 - (void)leaveFullscreen
76     fullscreen = NO;
77     SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
78     [self setFrame:initialFrame display:YES animate:YES];
81 - (BOOL)stretchesVideo
83     return NO;
86 - (void)setOnTop: (BOOL)ontop
90 @end