4 by Nicolas Plourde <nicolasplourde@gmail.com>
6 Copyright (c) Nicolas Plourde - 2005
8 MPlayer Mac OSX video out module.
11 #import <Cocoa/Cocoa.h>
12 #import <QuartzCore/QuartzCore.h>
13 #import <QuickTime/QuickTime.h>
15 // MPlayer OS X VO Protocol
16 @protocol MPlayerOSXVOProto
17 - (int) startWithWidth
: (bycopy
int)width
18 withHeight
: (bycopy
int)height
19 withBytes
: (bycopy
int)bytes
20 withAspect
: (bycopy
int)aspect
;
23 - (void) toggleFullscreen
;
27 @interface MPlayerOpenGLView
: NSOpenGLView
31 NSOpenGLContext
*glContext
;
35 CVPixelBufferRef frameBuffers
[2];
36 CVOpenGLTextureCacheRef textureCache
;
37 CVOpenGLTextureRef texture
;
41 GLfloat lowerRight
[2];
42 GLfloat upperRight
[2];
50 NSMenuItem
*kHalfScreenCmd
;
51 NSMenuItem
*kNormalScreenCmd
;
52 NSMenuItem
*kDoubleScreenCmd
;
53 NSMenuItem
*kFullScreenCmd
;
54 NSMenuItem
*kKeepAspectCmd
;
55 NSMenuItem
*kAspectOrgCmd
;
56 NSMenuItem
*kAspectFullCmd
;
57 NSMenuItem
*kAspectWideCmd
;
58 NSMenuItem
*kPanScanCmd
;
60 //timestamps for disabling screensaver and mouse hiding
62 int lastScreensaverUpdate
;
65 - (BOOL
) acceptsFirstResponder
;
66 - (BOOL
) becomeFirstResponder
;
67 - (BOOL
) resignFirstResponder
;
72 - (void) prepareOpenGL
;
75 - (void) setCurrentTexture
;
76 - (void) drawRect
: (NSRect
*) bounds
;
79 - (void) fullscreen
: (BOOL
) animate
;
86 - (void) menuAction
:(id
)sender
;
89 - (void) keyDown
: (NSEvent
*) theEvent
;
90 - (void) mouseMoved
: (NSEvent
*) theEvent
;
91 - (void) mouseDown
: (NSEvent
*) theEvent
;
92 - (void) mouseUp
: (NSEvent
*) theEvent
;
93 - (void) rightMouseDown
: (NSEvent
*) theEvent
;
94 - (void) rightMouseUp
: (NSEvent
*) theEvent
;
95 - (void) otherMouseDown
: (NSEvent
*) theEvent
;
96 - (void) otherMouseUp
: (NSEvent
*) theEvent
;
97 - (void) scrollWheel
: (NSEvent
*) theEvent
;
98 - (void) mouseEvent
: (NSEvent
*) theEvent
;
99 - (void) check_events
;