2 * CoreVideo video output driver
4 * Copyright (c) 2005 Nicolas Plourde <nicolasplourde@gmail.com>
6 * This file is part of MPlayer.
8 * MPlayer is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * MPlayer is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #import <Cocoa/Cocoa.h>
24 #import <QuartzCore/QuartzCore.h>
25 #import <Carbon/Carbon.h>
27 // MPlayer OS X VO Protocol
28 @protocol MPlayerOSXVOProto
29 - (int) startWithWidth
: (bycopy
int)width
30 withHeight
: (bycopy
int)height
31 withBytes
: (bycopy
int)bytes
32 withAspect
: (bycopy
int)aspect
;
35 - (void) toggleFullscreen
;
39 @interface MPlayerOpenGLView
: NSOpenGLView
46 CVPixelBufferRef frameBuffers
[2];
47 CVOpenGLTextureCacheRef textureCache
;
48 CVOpenGLTextureRef texture
;
52 GLfloat lowerRight
[2];
53 GLfloat upperRight
[2];
59 NSMenuItem
*kHalfScreenCmd
;
60 NSMenuItem
*kNormalScreenCmd
;
61 NSMenuItem
*kDoubleScreenCmd
;
62 NSMenuItem
*kFullScreenCmd
;
63 NSMenuItem
*kKeepAspectCmd
;
64 NSMenuItem
*kAspectOrgCmd
;
65 NSMenuItem
*kAspectFullCmd
;
66 NSMenuItem
*kAspectWideCmd
;
67 NSMenuItem
*kPanScanCmd
;
69 //timestamps for disabling screensaver and mouse hiding
71 int lastScreensaverUpdate
;
76 - (BOOL
) acceptsFirstResponder
;
77 - (BOOL
) becomeFirstResponder
;
78 - (BOOL
) resignFirstResponder
;
83 - (void) prepareOpenGL
;
86 - (void) setCurrentTexture
;
87 - (void) drawRect
: (NSRect
*) bounds
;
90 - (void) fullscreen
: (BOOL
) animate
;
97 - (void) menuAction
:(id
)sender
;
100 - (void) keyDown
: (NSEvent
*) theEvent
;
101 - (void) mouseMoved
: (NSEvent
*) theEvent
;
102 - (void) mouseDown
: (NSEvent
*) theEvent
;
103 - (void) mouseUp
: (NSEvent
*) theEvent
;
104 - (void) rightMouseDown
: (NSEvent
*) theEvent
;
105 - (void) rightMouseUp
: (NSEvent
*) theEvent
;
106 - (void) otherMouseDown
: (NSEvent
*) theEvent
;
107 - (void) otherMouseUp
: (NSEvent
*) theEvent
;
108 - (void) scrollWheel
: (NSEvent
*) theEvent
;
109 - (void) mouseEvent
: (NSEvent
*) theEvent
;
110 - (void) check_events
;