From fd290901bb069ca3160bb6b4eb738c19e6a0159e Mon Sep 17 00:00:00 2001 From: nplourde Date: Sat, 8 Apr 2006 16:16:48 +0000 Subject: Replace deprecated function git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18058 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_macosx.m | 32 ++++++++++++-------------------- libvo/vo_quartz.c | 28 ++++++++++------------------ 2 files changed, 22 insertions(+), 38 deletions(-) (limited to 'libvo') diff --git a/libvo/vo_macosx.m b/libvo/vo_macosx.m index ccb3c1e73a..4d289772ec 100644 --- a/libvo/vo_macosx.m +++ b/libvo/vo_macosx.m @@ -167,7 +167,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ //connnect to mplayerosx mplayerosxProxy=[NSConnection rootProxyForConnectionWithRegisteredName:@"mplayerosx" host:nil]; - [mplayerosxProxy startWithWidth: image_width withHeight: image_height withBytes: image_bytes withAspect:movie_aspect]; + [mplayerosxProxy startWithWidth: image_width withHeight: image_height withBytes: image_bytes withAspect:(int)(movie_aspect*100)]; } return 0; } @@ -249,7 +249,7 @@ static void uninit(void) } SetSystemUIMode( kUIModeNormal, 0); - ShowCursor(); + CGDisplayShowCursor(kCGDirectMainDisplay); [autoreleasepool release]; } @@ -708,16 +708,12 @@ static int control(uint32_t request, void *data, ...) //auto hide mouse cursor and futur on-screen control? if(isFullscreen && !mouseHide && !isRootwin) { - DateTimeRec d; - unsigned long curTime; - static unsigned long lastTime = 0; + int curTime = TickCount()/60; + static int lastTime = 0; - GetTime(&d); - DateToSeconds( &d, &curTime); - if( ((curTime - lastTime) >= 5) || (lastTime == 0) ) { - HideCursor(); + CGDisplayHideCursor(kCGDirectMainDisplay); mouseHide = YES; lastTime = curTime; } @@ -725,14 +721,10 @@ static int control(uint32_t request, void *data, ...) //update activity every 30 seconds to prevent //screensaver from starting up. - DateTimeRec d; - unsigned long curTime; - static unsigned long lastTime = 0; - - GetTime(&d); - DateToSeconds( &d, &curTime); - - if( ( (curTime - lastTime) >= 30) || (lastTime == 0)) + int curTime = TickCount()/60; + static int lastTime = 0; + + if( ((curTime - lastTime) >= 30) || (lastTime == 0) ) { UpdateSystemActivity(UsrActivity); lastTime = curTime; @@ -782,7 +774,7 @@ static int control(uint32_t request, void *data, ...) if(!isRootwin) { SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); - HideCursor(); + CGDisplayHideCursor(kCGDirectMainDisplay); mouseHide = YES; } @@ -803,7 +795,7 @@ static int control(uint32_t request, void *data, ...) SetSystemUIMode( kUIModeNormal, 0); isFullscreen = 0; - ShowCursor(); + CGDisplayShowCursor(kCGDirectMainDisplay); mouseHide = NO; //revert window to previous setting @@ -946,7 +938,7 @@ static int control(uint32_t request, void *data, ...) { if(isFullscreen && !isRootwin) { - ShowCursor(); + CGDisplayShowCursor(kCGDirectMainDisplay); mouseHide = NO; } } diff --git a/libvo/vo_quartz.c b/libvo/vo_quartz.c index b0d0497461..ebef1a3dc3 100644 --- a/libvo/vo_quartz.c +++ b/libvo/vo_quartz.c @@ -282,7 +282,7 @@ static OSStatus MouseEventHandler(EventHandlerCallRef nextHandler, EventRef even { if(vo_quartz_fs) { - ShowCursor(); + CGDisplayShowCursor(kCGDirectMainDisplay); mouseHide = FALSE; } } @@ -967,16 +967,12 @@ static void flip_page(void) //auto hide mouse cursor and futur on-screen control? if(vo_quartz_fs && !mouseHide) { - DateTimeRec d; - unsigned long curTime; - static unsigned long lastTime = 0; + int curTime = TickCount()/60; + static int lastTime = 0; - GetTime(&d); - DateToSeconds( &d, &curTime); - if( ((curTime - lastTime) >= 5) || (lastTime == 0) ) { - HideCursor(); + CGDisplayHideCursor(kCGDirectMainDisplay); mouseHide = TRUE; lastTime = curTime; } @@ -984,14 +980,10 @@ static void flip_page(void) //update activity every 30 seconds to prevent //screensaver from starting up. - DateTimeRec d; - unsigned long curTime; - static unsigned long lastTime = 0; - - GetTime(&d); - DateToSeconds( &d, &curTime); - - if( ( (curTime - lastTime) >= 30) || (lastTime == 0)) + int curTime = TickCount()/60; + static int lastTime = 0; + + if( ((curTime/ - lastTime) >= 5) || (lastTime == 0) ) { UpdateSystemActivity(UsrActivity); lastTime = curTime; @@ -1359,7 +1351,7 @@ void window_fullscreen() if(device_id == 0) { SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); - HideCursor(); + CGDisplayHideCursor(kCGDirectMainDisplay); mouseHide = TRUE; } @@ -1407,7 +1399,7 @@ void window_fullscreen() SetSystemUIMode( kUIModeNormal, NULL); //show mouse cursor - ShowCursor(); + CGDisplayShowCursor(kCGDirectMainDisplay); mouseHide = FALSE; //revert window to previous setting -- cgit v1.2.3