]> git.sesse.net Git - vlc/blob - modules/gui/macosx/Windows.h
macosx: update copyright headers for some recently changed files
[vlc] / modules / gui / macosx / Windows.h
1 /*****************************************************************************
2  * Windows.h: MacOS X interface module
3  *****************************************************************************
4  * Copyright (C) 2012-2013 VLC authors and VideoLAN
5  * $Id$
6  *
7  * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
8  *          David Fuhrmann <david dot fuhrmann at googlemail dot com>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #import <Cocoa/Cocoa.h>
26 #import "CompatibilityFixes.h"
27
28 /*****************************************************************************
29  * VLCWindow
30  *
31  *  Missing extension to NSWindow
32  *****************************************************************************/
33
34 @class VLCVoutView;
35
36 @interface VLCWindow : NSWindow
37 {
38     BOOL b_canBecomeKeyWindow;
39     BOOL b_isset_canBecomeKeyWindow;
40     BOOL b_canBecomeMainWindow;
41     BOOL b_isset_canBecomeMainWindow;
42     NSViewAnimation *o_current_animation;
43
44     BOOL              b_has_active_video;
45
46     /* 
47      * YES when all animations are over
48      * for fullscreen window: always YES
49      */
50     BOOL              b_fullscreen;
51 }
52 @property (readwrite) BOOL canBecomeKeyWindow;
53 @property (readwrite) BOOL canBecomeMainWindow;
54
55 @property (nonatomic, readwrite) BOOL hasActiveVideo;
56 @property (nonatomic, readwrite) BOOL fullscreen;
57
58 /* animate mode is only supported in >=10.4 */
59 - (void)orderFront: (id)sender animate: (BOOL)animate;
60
61 /* animate mode is only supported in >=10.4 */
62 - (void)orderOut: (id)sender animate: (BOOL)animate;
63
64 /* animate mode is only supported in >=10.4 */
65 - (void)orderOut: (id)sender animate: (BOOL)animate callback:(NSInvocation *)callback;
66
67 /* animate mode is only supported in >=10.4 */
68 - (void)closeAndAnimate: (BOOL)animate;
69
70 - (VLCVoutView *)videoView;
71
72 @end
73
74
75 static const float f_min_video_height = 70.0;
76
77 @class VLCControlsBarCommon;
78
79 /*****************************************************************************
80  * VLCVideoWindowCommon
81  *
82  *  Common code for main window, detached window and extra video window
83  *****************************************************************************/
84
85 @interface VLCVideoWindowCommon : VLCWindow <NSWindowDelegate, NSAnimationDelegate>
86 {
87     NSRect previousSavedFrame;
88     BOOL b_dark_interface;
89
90     IBOutlet id o_titlebar_view; // only set in main or detached window
91     IBOutlet VLCVoutView *o_video_view;
92
93     IBOutlet VLCControlsBarCommon *o_controls_bar;
94
95     NSSize nativeVideoSize;
96
97     // variables for fullscreen handling
98     VLCVideoWindowCommon *o_current_video_window;
99     VLCWindow       * o_fullscreen_window;
100     NSViewAnimation * o_fullscreen_anim1;
101     NSViewAnimation * o_fullscreen_anim2;
102     NSViewAnimation * o_makekey_anim;
103     NSView          * o_temp_view;
104
105     BOOL              b_window_is_invisible;
106     NSRecursiveLock * o_animation_lock;
107     NSInteger i_originalLevel;
108
109     NSTimer *t_hide_mouse_timer;
110
111     // true when the window is in transition for entering lion fullscreen
112     BOOL b_entering_fullscreen_transition;
113 }
114
115 @property (nonatomic, assign) VLCVoutView* videoView;
116 @property (readonly) VLCControlsBarCommon* controlsBar;
117 @property (readonly) BOOL enteringFullscreenTransition;
118
119 - (void)setWindowLevel:(NSInteger)i_state;
120
121 - (void)resizeWindow;
122 - (void)setNativeVideoSize:(NSSize)size;
123 - (NSRect)getWindowRectForProposedVideoViewSize:(NSSize)size;
124
125
126 - (void)setTitle:(NSString *)title;
127
128 /* fullscreen handling */
129 - (void)enterFullscreen;
130 - (void)leaveFullscreen;
131
132 /* lion fullscreen handling */
133 - (void)windowWillEnterFullScreen:(NSNotification *)notification;
134 - (void)windowDidEnterFullScreen:(NSNotification *)notification;
135 - (void)windowWillExitFullScreen:(NSNotification *)notification;
136
137 @end