vo_corevideo: move mouse hiding to check_events
[mplayer/glamo.git] / libvo / vo_corevideo.h
blob85406661b9e00d8ac737bc2e2a1d9b5cdf6f562c
1 /*
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;
33 - (void) stop;
34 - (void) render;
35 - (void) toggleFullscreen;
36 - (void) ontop;
37 @end
39 @interface MPlayerOpenGLView : NSOpenGLView
41 //Cocoa
42 NSWindow *window;
43 NSEvent *event;
45 //CoreVideo
46 CVPixelBufferRef frameBuffers[2];
47 CVOpenGLTextureCacheRef textureCache;
48 CVOpenGLTextureRef texture;
49 NSRect textureFrame;
51 GLfloat lowerLeft[2];
52 GLfloat lowerRight[2];
53 GLfloat upperRight[2];
54 GLfloat upperLeft[2];
56 BOOL mouseHide;
58 //menu command id
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
70 int lastMouseHide;
71 int lastScreensaverUpdate;
72 @public
73 float winSizeMult;
76 - (BOOL) acceptsFirstResponder;
77 - (BOOL) becomeFirstResponder;
78 - (BOOL) resignFirstResponder;
80 //window & rendering
81 - (void) preinit;
82 - (void) config;
83 - (void) prepareOpenGL;
84 - (void) render;
85 - (void) reshape;
86 - (void) setCurrentTexture;
87 - (void) drawRect: (NSRect *) bounds;
89 //vo control
90 - (void) fullscreen: (BOOL) animate;
91 - (void) ontop;
92 - (void) panscan;
93 - (void) rootwin;
95 //menu
96 - (void) initMenu;
97 - (void) menuAction:(id)sender;
99 //event
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;
111 @end