00001 /***************************************************************************** 00002 * VLCOpenGLVoutView.h: MacOS X OpenGL provider 00003 ***************************************************************************** 00004 * Copyright (C) 2001-2007 the VideoLAN team 00005 * $Id: 3045843c6e7bf44bdb9550938259679aed7e8a6f $ 00006 * 00007 * Authors: Colin Delacroix <colin@zoy.org> 00008 * Florian G. Pflug <fgp@phlo.org> 00009 * Jon Lech Johansen <jon-vl@nanocrew.net> 00010 * Derk-Jan Hartman <hartman at videolan dot org> 00011 * Eric Petit <titer@m0k.org> 00012 * Benjamin Pracht <bigben at videolan dot org> 00013 * Damien Fouilleul <damienf at videolan dot org> 00014 * 00015 * This program is free software; you can redistribute it and/or modify 00016 * it under the terms of the GNU General Public License as published by 00017 * the Free Software Foundation; either version 2 of the License, or 00018 * (at your option) any later version. 00019 * 00020 * This program is distributed in the hope that it will be useful, 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 * GNU General Public License for more details. 00024 * 00025 * You should have received a copy of the GNU General Public License 00026 * along with this program; if not, write to the Free Software 00027 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 00028 *****************************************************************************/ 00029 00030 #import <Cocoa/Cocoa.h> 00031 00032 #include <OpenGL/OpenGL.h> 00033 #include <OpenGL/gl.h> 00034 00035 #include <vlc_common.h> 00036 00037 /* Entry point */ 00038 int cocoaglvoutviewInit( vout_thread_t * p_vout ); 00039 void cocoaglvoutviewEnd( vout_thread_t * p_vout ); 00040 int cocoaglvoutviewManage( vout_thread_t * p_vout ); 00041 int cocoaglvoutviewControl( vout_thread_t *p_vout, int i_query, va_list args ); 00042 void cocoaglvoutviewSwap( vout_thread_t * p_vout ); 00043 int cocoaglvoutviewLock( vout_thread_t * p_vout ); 00044 void cocoaglvoutviewUnlock( vout_thread_t * p_vout ); 00045 00046 /* To commmunicate with the VLC.framework */ 00047 @protocol VLCOpenGLVoutEmbedding <NSObject> 00048 - (void)addVoutSubview:(NSView *)view; 00049 - (void)removeVoutSubview:(NSView *)view; 00050 00051 - (void)enterFullscreen; 00052 - (void)leaveFullscreen; 00053 00054 - (BOOL)stretchesVideo; 00055 00056 - (void)setOnTop: (BOOL)ontop; /* Do we really want that in protocol? */ 00057 @end 00058 00059 /* VLCOpenGLVoutView */ 00060 @interface VLCOpenGLVoutView : NSOpenGLView 00061 { 00062 id <VLCOpenGLVoutEmbedding> container; 00063 vout_thread_t * p_vout; 00064 NSLock * objectLock; 00065 } 00066 /* Init a new gl view and register it to both the framework and the 00067 * vout_thread_t. Must be called from main thread */ 00068 + (void) autoinitOpenGLVoutViewIntVoutWithContainer: (NSData *) args; 00069 00070 - (id) initWithVout: (vout_thread_t *) vout container: (id <VLCOpenGLVoutEmbedding>) container; 00071 00072 - (void) detachFromVout; 00073 - (id <VLCOpenGLVoutEmbedding>) container; 00074 00075 - (void) reshape; 00076 - (void) update; 00077 - (void) drawRect: (NSRect) rect; 00078 @end 00079
1.5.6