2005-04-29 11:05:16 +00:00
|
|
|
/*
|
|
|
|
vo_macosx.h
|
|
|
|
|
|
|
|
by Nicolas Plourde <nicolasplourde@gmail.com>
|
|
|
|
|
|
|
|
Copyright (c) Nicolas Plourde - 2005
|
|
|
|
|
|
|
|
MPlayer Mac OSX video out module.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#import <QuartzCore/QuartzCore.h>
|
2005-05-02 18:05:59 +00:00
|
|
|
#import <QuickTime/QuickTime.h>
|
2005-04-29 11:05:16 +00:00
|
|
|
|
2005-06-02 14:10:52 +00:00
|
|
|
@interface MPlayerOpenGLView : NSOpenGLView
|
2005-04-29 11:05:16 +00:00
|
|
|
{
|
|
|
|
//Cocoa
|
|
|
|
NSWindow *window;
|
|
|
|
NSOpenGLContext *glContext;
|
|
|
|
NSEvent *event;
|
|
|
|
|
|
|
|
//CoreVideo
|
|
|
|
CVPixelBufferRef currentFrameBuffer;
|
|
|
|
CVOpenGLTextureCacheRef textureCache;
|
|
|
|
CVOpenGLTextureRef texture;
|
2005-06-15 21:49:50 +00:00
|
|
|
NSRect textureFrame;
|
2005-04-29 11:05:16 +00:00
|
|
|
|
|
|
|
GLfloat lowerLeft[2];
|
|
|
|
GLfloat lowerRight[2];
|
|
|
|
GLfloat upperRight[2];
|
|
|
|
GLfloat upperLeft[2];
|
|
|
|
|
|
|
|
BOOL mouseHide;
|
2005-06-29 21:54:48 +00:00
|
|
|
float winSizeMult;
|
2005-05-25 23:38:59 +00:00
|
|
|
|
|
|
|
//menu command id
|
|
|
|
NSMenuItem *kQuitCmd;
|
|
|
|
NSMenuItem *kHalfScreenCmd;
|
|
|
|
NSMenuItem *kNormalScreenCmd;
|
|
|
|
NSMenuItem *kDoubleScreenCmd;
|
|
|
|
NSMenuItem *kFullScreenCmd;
|
|
|
|
NSMenuItem *kKeepAspectCmd;
|
|
|
|
NSMenuItem *kAspectOrgCmd;
|
|
|
|
NSMenuItem *kAspectFullCmd;
|
|
|
|
NSMenuItem *kAspectWideCmd;
|
|
|
|
NSMenuItem *kPanScanCmd;
|
2005-04-29 11:05:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL) acceptsFirstResponder;
|
|
|
|
- (BOOL) becomeFirstResponder;
|
|
|
|
- (BOOL) resignFirstResponder;
|
|
|
|
|
|
|
|
//window & rendering
|
2005-06-15 14:48:33 +00:00
|
|
|
- (id) preinit;
|
|
|
|
- (id) config;
|
2005-04-29 11:05:16 +00:00
|
|
|
- (void) prepareOpenGL;
|
|
|
|
- (void) render;
|
|
|
|
- (void) reshape;
|
|
|
|
- (void) setCurrentTexture;
|
|
|
|
- (void) drawRect: (NSRect *) bounds;
|
2005-06-02 14:10:52 +00:00
|
|
|
|
|
|
|
//vo control
|
2005-04-29 11:05:16 +00:00
|
|
|
- (void) fullscreen: (BOOL) animate;
|
|
|
|
- (void) ontop;
|
|
|
|
- (void) panscan;
|
2005-05-02 18:05:59 +00:00
|
|
|
- (void) rootwin;
|
2005-04-29 11:05:16 +00:00
|
|
|
|
2005-06-02 14:10:52 +00:00
|
|
|
//menu
|
|
|
|
- (void) initMenu;
|
|
|
|
- (void) menuAction:(id)sender;
|
|
|
|
|
2005-04-29 11:05:16 +00:00
|
|
|
//event
|
|
|
|
- (void) keyDown: (NSEvent *) theEvent;
|
|
|
|
- (void) mouseMoved: (NSEvent *) theEvent;
|
|
|
|
- (void) mouseDown: (NSEvent *) theEvent;
|
|
|
|
- (void) rightMouseDown: (NSEvent *) theEvent;
|
|
|
|
- (void) otherMouseDown: (NSEvent *) theEvent;
|
|
|
|
- (void) scrollWheel: (NSEvent *) theEvent;
|
|
|
|
- (void) mouseEvent: (NSEvent *) theEvent;
|
|
|
|
- (void) check_events;
|
|
|
|
@end
|