diff options
author | Andre Pang <athp@users.sourceforge.net> | 2004-10-20 07:17:46 +0000 |
---|---|---|
committer | Andre Pang <athp@users.sourceforge.net> | 2004-10-20 07:17:46 +0000 |
commit | e9cf35f2a0814e5e958f04b63bc97ec351d61d5e (patch) | |
tree | 893b2d88caf45da011a0bc511d8f5202252885e1 /src/video_out/macosx | |
parent | 3a99599c38a11e58d82b3700f30af73891e5c6e6 (diff) | |
download | xine-lib-e9cf35f2a0814e5e958f04b63bc97ec351d61d5e.tar.gz xine-lib-e9cf35f2a0814e5e958f04b63bc97ec351d61d5e.tar.bz2 |
Mac OS X video output:
Remove superfluous point flip in mouseMoved:
Added mouseDown:, rightMouseDown:, and otherMouseDown: event handlers
CVS patchset: 7056
CVS date: 2004/10/20 07:17:46
Diffstat (limited to 'src/video_out/macosx')
-rw-r--r-- | src/video_out/macosx/video_window.h | 2 | ||||
-rw-r--r-- | src/video_out/macosx/video_window.m | 54 |
2 files changed, 41 insertions, 15 deletions
diff --git a/src/video_out/macosx/video_window.h b/src/video_out/macosx/video_window.h index 4d4dba37c..5b2dc9dcf 100644 --- a/src/video_out/macosx/video_window.h +++ b/src/video_out/macosx/video_window.h @@ -32,7 +32,7 @@ typedef enum { } XineVideoWindowFullScreenMode; @interface XineOpenGLView : NSOpenGLView { - IBOutlet id <XineOpenGLViewDelegate> delegate; + IBOutlet id <NSObject, XineOpenGLViewDelegate> delegate; int video_width, video_height; char *texture_buffer; unsigned long i_texture; diff --git a/src/video_out/macosx/video_window.m b/src/video_out/macosx/video_window.m index 6aa189ba0..d04ad139b 100644 --- a/src/video_out/macosx/video_window.m +++ b/src/video_out/macosx/video_window.m @@ -41,8 +41,10 @@ NSString *XineViewDidResizeNotification = @"XineViewDidResizeNotification"; @protocol XineOpenGLViewDelegate -- (void) mouseMoved:(NSEvent *)theEvent inXineView:(XineOpenGLView *)view; -- (BOOL) respondsToSelector:(SEL)selector; +- (void) mouseDown:(NSEvent *)theEvent inXineView:(XineOpenGLView *)theView; +- (void) mouseMoved:(NSEvent *)theEvent inXineView:(XineOpenGLView *)theView; +- (void) otherMouseDown:(NSEvent *)theEvent inXineView:(XineOpenGLView *)theView; +- (void) rightMouseDown:(NSEvent *)theEvent inXineView:(XineOpenGLView *)theView; - (NSSize) xineViewWillResize:(NSSize)oldSize toSize:(NSSize)proposedSize; - (void) xineViewDidResize:(NSNotification *)note; @@ -193,28 +195,52 @@ NSString *XineViewDidResizeNotification = @"XineViewDidResizeNotification"; return YES; } -- (void)mouseMoved:(NSEvent *)theEvent +- (void)passEventToDelegate:(NSEvent *)theEvent withSelector:(SEL)selector { NSPoint point = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - NSRect bounds = [self bounds]; - - if (!NSMouseInRect(point, bounds, [self isFlipped])) return; + if (!NSMouseInRect(point, [self bounds], [self isFlipped])) return; - /* flip the y axis */ - point.y = bounds.size.height - point.y; -#ifdef LOG_MOUSE - NSLog(@"XineOpenGLView: mouse at x:%f y:%f", point.x, point.y); -#endif - - if ([delegate respondsToSelector:@selector(mouseMoved:inXineView:)]) { - (void) [delegate mouseMoved:theEvent inXineView:self]; + if ([delegate respondsToSelector:selector]) { + [delegate performSelector:selector + withObject:theEvent + withObject:self]; } +} + +- (void)mouseMoved:(NSEvent *)theEvent +{ + [self passEventToDelegate:theEvent + withSelector:@selector(mouseMoved:inXineView:)]; [super mouseMoved:theEvent]; } +- (void)mouseDown:(NSEvent *)theEvent +{ + [self passEventToDelegate:theEvent + withSelector:@selector(mouseDown:inXineView:)]; + + [super mouseDown:theEvent]; +} + +- (void)rightMouseDown:(NSEvent *)theEvent +{ + [self passEventToDelegate:theEvent + withSelector:@selector(rightMouseDown:inXineView:)]; + + [super rightMouseDown:theEvent]; +} + +- (void)otherMouseDown:(NSEvent *)theEvent +{ + [self passEventToDelegate:theEvent + withSelector:@selector(otherMouseDown:inXineView:)]; + + [super otherMouseDown:theEvent]; +} + - (NSSize)videoSize { return NSMakeSize(video_width, video_height); } |