annotate libvo/osx_objc_common.h @ 35411:abece00352ec

Prevent dropping last frames in vd_black.
author upsuper
date Thu, 29 Nov 2012 04:52:19 +0000
parents 967b0f13715c
children f51965824a2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
35086
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
1 /*
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
2 * CoreVideo video output driver
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
3 *
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
4 * Copyright (c) 2005 Nicolas Plourde <nicolasplourde@gmail.com>
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
5 *
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
6 * This file is part of MPlayer.
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
7 *
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
8 * MPlayer is free software; you can redistribute it and/or modify
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
11 * (at your option) any later version.
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
12 *
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
13 * MPlayer is distributed in the hope that it will be useful,
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
16 * GNU General Public License for more details.
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
17 *
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License along
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
19 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
21 */
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
22
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
23 #ifndef MPLAYER_OSX_OBJC_COMMON_H
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
24 #define MPLAYER_OSX_OBJC_COMMON_H
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
25
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
26 #import <Cocoa/Cocoa.h>
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
27
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
28 @interface MPCommonOpenGLView : NSOpenGLView
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
29 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
30 <NSWindowDelegate>
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
31 #endif
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
32 {
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
33 //Cocoa
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
34 NSWindow *window;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
35
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
36 BOOL mouseHide;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
37
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
38 //menu command id
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
39 NSMenuItem *kHalfScreenCmd;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
40 NSMenuItem *kNormalScreenCmd;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
41 NSMenuItem *kDoubleScreenCmd;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
42 NSMenuItem *kFullScreenCmd;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
43 NSMenuItem *kKeepAspectCmd;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
44 NSMenuItem *kAspectOrgCmd;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
45 NSMenuItem *kAspectFullCmd;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
46 NSMenuItem *kAspectWideCmd;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
47 NSMenuItem *kPanScanCmd;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
48
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
49 //timestamps for disabling screensaver and mouse hiding
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
50 int lastMouseHide;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
51 int lastScreensaverUpdate;
35091
9fcfc9c5f038 gl OSX backend: Detect and pass on resize events
reimar
parents: 35086
diff changeset
52
9fcfc9c5f038 gl OSX backend: Detect and pass on resize events
reimar
parents: 35086
diff changeset
53 int event_flags;
35086
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
54 @public
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
55 float winSizeMult;
35094
967b0f13715c Provide a swap buffer function for OS X.
reimar
parents: 35092
diff changeset
56 NSOpenGLContext *glContext;
35086
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
57 }
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
58
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
59 - (BOOL) acceptsFirstResponder;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
60 - (BOOL) becomeFirstResponder;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
61 - (BOOL) resignFirstResponder;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
62
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
63 //window & rendering
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
64 - (void) preinit;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
65 - (void) config:(uint32_t)width:(uint32_t)height:(uint32_t)flags;
35092
cc8276116e95 gl: support screen redraw on OSX.
reimar
parents: 35091
diff changeset
66 - (void) drawRect: (NSRect *) bounds;
35091
9fcfc9c5f038 gl OSX backend: Detect and pass on resize events
reimar
parents: 35086
diff changeset
67 - (void) reshape;
35086
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
68
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
69 //vo control
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
70 - (void) fullscreen: (BOOL) animate;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
71 - (void) ontop;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
72 - (void) rootwin;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
73
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
74 //menu
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
75 - (void) initMenu;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
76 - (void) menuAction:(id)sender;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
77
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
78 //event
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
79 - (void) keyDown: (NSEvent *) theEvent;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
80 - (void) mouseMoved: (NSEvent *) theEvent;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
81 - (void) mouseDown: (NSEvent *) theEvent;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
82 - (void) mouseUp: (NSEvent *) theEvent;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
83 - (void) rightMouseDown: (NSEvent *) theEvent;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
84 - (void) rightMouseUp: (NSEvent *) theEvent;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
85 - (void) otherMouseDown: (NSEvent *) theEvent;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
86 - (void) otherMouseUp: (NSEvent *) theEvent;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
87 - (void) scrollWheel: (NSEvent *) theEvent;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
88 - (void) mouseEvent: (NSEvent *) theEvent;
35091
9fcfc9c5f038 gl OSX backend: Detect and pass on resize events
reimar
parents: 35086
diff changeset
89 - (int) check_events;
35086
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
90
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
91 - (void) update_screen_info;
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
92 @end
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
93
8848682f4035 Split out an objective-C common OS X layer, to be reused by -vo gl.
reimar
parents:
diff changeset
94 #endif /* MPLAYER_OSX_OBJC_COMMON_H */