Mercurial > mplayer.hg
annotate libvo/vo_macosx.h @ 28063:a318969a4f45
Set the base size window manager hint, otherwise some subtract the minimum
size of 4x4 from the numbers displayed to the user which might be confusing.
Based on patch by Bert Wesarg [bert wesarg googlemail com].
author | reimar |
---|---|
date | Fri, 05 Dec 2008 19:01:49 +0000 |
parents | 0a0f63090e60 |
children | 7681eab10aea |
rev | line source |
---|---|
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 |
25157
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
15 // MPlayer OS X VO Protocol |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
16 @protocol MPlayerOSXVOProto |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
17 - (int) startWithWidth: (bycopy int)width |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
18 withHeight: (bycopy int)height |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
19 withBytes: (bycopy int)bytes |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
20 withAspect: (bycopy int)aspect; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
21 - (void) stop; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
22 - (void) render; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
23 - (void) toggleFullscreen; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
24 - (void) ontop; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
25 @end |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
26 |
15611 | 27 @interface MPlayerOpenGLView : NSOpenGLView |
15289 | 28 { |
29 //Cocoa | |
30 NSWindow *window; | |
31 NSOpenGLContext *glContext; | |
32 NSEvent *event; | |
33 | |
34 //CoreVideo | |
25180 | 35 CVPixelBufferRef frameBuffers[2]; |
15289 | 36 CVOpenGLTextureCacheRef textureCache; |
37 CVOpenGLTextureRef texture; | |
15729 | 38 NSRect textureFrame; |
15289 | 39 |
40 GLfloat lowerLeft[2]; | |
41 GLfloat lowerRight[2]; | |
42 GLfloat upperRight[2]; | |
43 GLfloat upperLeft[2]; | |
44 | |
45 BOOL mouseHide; | |
15855 | 46 float winSizeMult; |
15570 | 47 |
48 //menu command id | |
49 NSMenuItem *kQuitCmd; | |
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; | |
28010
0a0f63090e60
factorize mouse hiding and screensaver disabling code
gpoirier
parents:
25180
diff
changeset
|
59 |
0a0f63090e60
factorize mouse hiding and screensaver disabling code
gpoirier
parents:
25180
diff
changeset
|
60 //timestamps for disabling screensaver and mouse hiding |
0a0f63090e60
factorize mouse hiding and screensaver disabling code
gpoirier
parents:
25180
diff
changeset
|
61 int lastMouseHide; |
0a0f63090e60
factorize mouse hiding and screensaver disabling code
gpoirier
parents:
25180
diff
changeset
|
62 int lastScreensaverUpdate; |
15289 | 63 } |
64 | |
65 - (BOOL) acceptsFirstResponder; | |
66 - (BOOL) becomeFirstResponder; | |
67 - (BOOL) resignFirstResponder; | |
68 | |
69 //window & rendering | |
24076 | 70 - (void) preinit; |
71 - (void) config; | |
15289 | 72 - (void) prepareOpenGL; |
73 - (void) render; | |
74 - (void) reshape; | |
75 - (void) setCurrentTexture; | |
76 - (void) drawRect: (NSRect *) bounds; | |
15611 | 77 |
78 //vo control | |
15289 | 79 - (void) fullscreen: (BOOL) animate; |
80 - (void) ontop; | |
81 - (void) panscan; | |
15327 | 82 - (void) rootwin; |
15289 | 83 |
15611 | 84 //menu |
85 - (void) initMenu; | |
86 - (void) menuAction:(id)sender; | |
87 | |
15289 | 88 //event |
89 - (void) keyDown: (NSEvent *) theEvent; | |
90 - (void) mouseMoved: (NSEvent *) theEvent; | |
91 - (void) mouseDown: (NSEvent *) theEvent; | |
24077
9ce03980ed0c
added double click support in vo_macosx. Patch by Ulion <ulion2002@gmail.com>
nplourde
parents:
24076
diff
changeset
|
92 - (void) mouseUp: (NSEvent *) theEvent; |
15289 | 93 - (void) rightMouseDown: (NSEvent *) theEvent; |
24077
9ce03980ed0c
added double click support in vo_macosx. Patch by Ulion <ulion2002@gmail.com>
nplourde
parents:
24076
diff
changeset
|
94 - (void) rightMouseUp: (NSEvent *) theEvent; |
15289 | 95 - (void) otherMouseDown: (NSEvent *) theEvent; |
24077
9ce03980ed0c
added double click support in vo_macosx. Patch by Ulion <ulion2002@gmail.com>
nplourde
parents:
24076
diff
changeset
|
96 - (void) otherMouseUp: (NSEvent *) theEvent; |
15289 | 97 - (void) scrollWheel: (NSEvent *) theEvent; |
98 - (void) mouseEvent: (NSEvent *) theEvent; | |
99 - (void) check_events; | |
24075 | 100 @end |