]> git.sesse.net Git - vlc/blob - modules/gui/macosx/vout.h
macosx/vout*: fixed a possible segfault on vout close
[vlc] / modules / gui / macosx / vout.h
1 /*****************************************************************************
2  * vout.h: MacOS X interface module
3  *****************************************************************************
4  * Copyright (C) 2001-2003 VideoLAN
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  *          Eric Petit <titer@m0k.org>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  * 
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
25  *****************************************************************************/
26
27 /*****************************************************************************
28  * VLCWindow interface
29  *****************************************************************************/
30 @interface VLCWindow : NSWindow
31 {
32     vout_thread_t * p_vout;
33 }
34
35 - (void)setVout:(vout_thread_t *)_p_vout;
36 - (vout_thread_t *)getVout;
37
38 - (void)scaleWindowWithFactor: (float)factor;
39 - (void)toggleFloatOnTop;
40 - (void)toggleFullscreen;
41 - (BOOL)isFullscreen;
42 - (void)updateTitle;
43
44 - (BOOL)windowShouldClose:(id)sender;
45
46 @end
47
48 /*****************************************************************************
49  * VLCView interface
50  *****************************************************************************/
51 @interface VLCQTView : NSQuickDrawView
52 {
53 }
54
55 @end
56
57 /*****************************************************************************
58  * VLCView interface
59  *****************************************************************************/
60 @interface VLCGLView : NSOpenGLView
61 {
62     vout_thread_t   * p_vout;
63     int               i_effect;
64     unsigned long     pi_textures[2];
65     float             f_x;
66     float             f_y;
67     int               initDone;
68 }
69
70 - (id)   initWithFrame: (NSRect) frame vout: (vout_thread_t*) p_vout;
71 - (void) initTextures;
72 - (void) reloadTexture: (int) index;
73 - (void) cleanUp;
74
75 @end
76
77 /*****************************************************************************
78  * VLCVout interface
79  *****************************************************************************/
80 @interface VLCVout : NSObject
81 {
82 }
83
84 - (void)createWindow:(NSValue *)o_value;
85 - (void)destroyWindow:(NSValue *)o_value;
86
87 @end
88
89 /*****************************************************************************
90  * vout_sys_t: MacOS X video output method descriptor
91  *****************************************************************************/
92 struct vout_sys_t
93 {
94     int i_opengl;
95     
96     NSRect s_rect;
97     int b_pos_saved;
98     VLCWindow * o_window;
99
100     vlc_bool_t b_mouse_moved;
101     mtime_t i_time_mouse_last_moved;
102
103 #ifdef __QUICKTIME__
104     CodecType i_codec;
105     CGrafPtr p_qdport;
106     ImageSequence i_seq;
107     MatrixRecordPtr p_matrix;
108     DecompressorComponent img_dc;
109     ImageDescriptionHandle h_img_descr;
110     Ptr p_fullscreen_state;
111 #endif
112
113     /* OpenGL */
114     VLCGLView * o_glview;
115     uint8_t   * p_data[2];
116     uint8_t   * p_data_orig[2];
117     int         i_cur_pic;
118 };