]> git.sesse.net Git - vlc/blob - modules/gui/minimal_macosx/VLCOpenGLVoutView.h
minimal_macosx: Add miosx as shortcut too.
[vlc] / modules / gui / minimal_macosx / VLCOpenGLVoutView.h
1 /*****************************************************************************
2  * VLCOpenGLVoutView.h: MacOS X OpenGL provider
3  *****************************************************************************
4  * Copyright (C) 2001-2007 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Colin Delacroix <colin@zoy.org>
8  *          Florian G. Pflug <fgp@phlo.org>
9  *          Jon Lech Johansen <jon-vl@nanocrew.net>
10  *          Derk-Jan Hartman <hartman at videolan dot org>
11  *          Eric Petit <titer@m0k.org>
12  *          Benjamin Pracht <bigben at videolan dot org>
13  *          Damien Fouilleul <damienf at videolan dot org>
14  *
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 2 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
28  *****************************************************************************/
29
30 #import <Cocoa/Cocoa.h>
31
32 #include <OpenGL/OpenGL.h>
33 #include <OpenGL/gl.h>
34
35 #include <vlc_common.h>
36
37 /* Entry point */
38 int  cocoaglvoutviewInit( vout_thread_t * p_vout );
39 void cocoaglvoutviewEnd( vout_thread_t * p_vout );
40 int  cocoaglvoutviewManage( vout_thread_t * p_vout );
41 int  cocoaglvoutviewControl( vout_thread_t *p_vout, int i_query, va_list args );
42 void cocoaglvoutviewSwap( vout_thread_t * p_vout );
43 int  cocoaglvoutviewLock( vout_thread_t * p_vout );
44 void cocoaglvoutviewUnlock( vout_thread_t * p_vout );
45
46 /* To commmunicate with the VLC.framework */
47 @protocol VLCOpenGLVoutEmbedding
48 - (void)addVoutSubview:(NSView *)view;
49 - (void)removeVoutSubview:(NSView *)view;
50
51 - (void)enterFullscreen;
52 - (void)leaveFullscreen;
53
54 - (BOOL)stretchesVideo;
55
56 - (void)setOnTop: (BOOL)ontop; /* Do we really want that in protocol? */
57 @end
58
59 /* VLCOpenGLVoutView */
60 @interface VLCOpenGLVoutView : NSOpenGLView
61 {
62     id <VLCOpenGLVoutEmbedding> container;
63     vout_thread_t * p_vout;
64     NSLock        * objectLock;
65 }
66 /* Init a new gl view and register it to both the framework and the
67  * vout_thread_t. Must be called from main thread */
68 + (void) autoinitOpenGLVoutViewIntVoutWithContainer: (NSData *) args;
69
70 - (id) initWithVout: (vout_thread_t *) vout container: (id <VLCOpenGLVoutEmbedding>) container;
71
72 - (void) detachFromVout;
73 - (id <VLCOpenGLVoutEmbedding>) container;
74
75 - (void) reshape;
76 - (void) update;
77 - (void) drawRect: (NSRect) rect;
78 @end
79