15289
|
1 /*
|
|
2 vo_macosx.h
|
|
3
|
|
4 by Nicolas Plourde <nicolasplourde@gmail.com>
|
|
5
|
|
6 Copyright (c) Nicolas Plourde - 2005
|
|
7
|
|
8 MPlayer Mac OSX video out module.
|
|
9 */
|
|
10
|
|
11 #import <Cocoa/Cocoa.h>
|
|
12 #import <QuartzCore/QuartzCore.h>
|
15327
|
13 #import <QuickTime/QuickTime.h>
|
15289
|
14
|
15611
|
15 @interface MPlayerOpenGLView : NSOpenGLView
|
15289
|
16 {
|
|
17 //Cocoa
|
|
18 NSWindow *window;
|
|
19 NSOpenGLContext *glContext;
|
|
20 NSEvent *event;
|
|
21
|
|
22 //CoreVideo
|
|
23 CVPixelBufferRef currentFrameBuffer;
|
|
24 CVOpenGLTextureCacheRef textureCache;
|
|
25 CVOpenGLTextureRef texture;
|
15729
|
26 NSRect textureFrame;
|
15289
|
27
|
|
28 GLfloat lowerLeft[2];
|
|
29 GLfloat lowerRight[2];
|
|
30 GLfloat upperRight[2];
|
|
31 GLfloat upperLeft[2];
|
|
32
|
|
33 BOOL mouseHide;
|
15855
|
34 float winSizeMult;
|
15570
|
35
|
|
36 //menu command id
|
|
37 NSMenuItem *kQuitCmd;
|
|
38 NSMenuItem *kHalfScreenCmd;
|
|
39 NSMenuItem *kNormalScreenCmd;
|
|
40 NSMenuItem *kDoubleScreenCmd;
|
|
41 NSMenuItem *kFullScreenCmd;
|
|
42 NSMenuItem *kKeepAspectCmd;
|
|
43 NSMenuItem *kAspectOrgCmd;
|
|
44 NSMenuItem *kAspectFullCmd;
|
|
45 NSMenuItem *kAspectWideCmd;
|
|
46 NSMenuItem *kPanScanCmd;
|
15289
|
47 }
|
|
48
|
|
49 - (BOOL) acceptsFirstResponder;
|
|
50 - (BOOL) becomeFirstResponder;
|
|
51 - (BOOL) resignFirstResponder;
|
|
52
|
|
53 //window & rendering
|
15726
|
54 - (id) preinit;
|
|
55 - (id) config;
|
15289
|
56 - (void) prepareOpenGL;
|
|
57 - (void) render;
|
|
58 - (void) reshape;
|
|
59 - (void) setCurrentTexture;
|
|
60 - (void) drawRect: (NSRect *) bounds;
|
15611
|
61
|
|
62 //vo control
|
15289
|
63 - (void) fullscreen: (BOOL) animate;
|
|
64 - (void) ontop;
|
|
65 - (void) panscan;
|
15327
|
66 - (void) rootwin;
|
15289
|
67
|
15611
|
68 //menu
|
|
69 - (void) initMenu;
|
|
70 - (void) menuAction:(id)sender;
|
|
71
|
15289
|
72 //event
|
|
73 - (void) keyDown: (NSEvent *) theEvent;
|
|
74 - (void) mouseMoved: (NSEvent *) theEvent;
|
|
75 - (void) mouseDown: (NSEvent *) theEvent;
|
|
76 - (void) rightMouseDown: (NSEvent *) theEvent;
|
|
77 - (void) otherMouseDown: (NSEvent *) theEvent;
|
|
78 - (void) scrollWheel: (NSEvent *) theEvent;
|
|
79 - (void) mouseEvent: (NSEvent *) theEvent;
|
|
80 - (void) check_events;
|
|
81 @end |