Mercurial > mplayer.hg
changeset 35778:8ba56e7c14fb
Set MouseHandler for menu window.
Adjust parameters to prototype and use this handler to call the menu.
As a result, uiMenuMouse() can be static now.
author | ib |
---|---|
date | Fri, 25 Jan 2013 11:51:37 +0000 |
parents | 6d576acb772b |
children | 8ad72f9cf697 |
files | gui/ui/main.c gui/ui/menu.c gui/ui/playbar.c gui/ui/ui.h gui/ui/video.c |
diffstat | 5 files changed, 7 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/ui/main.c Fri Jan 25 11:14:11 2013 +0000 +++ b/gui/ui/main.c Fri Jan 25 11:51:37 2013 +0000 @@ -189,7 +189,7 @@ wsWindowMove( &guiApp.mainWindow,True,RX - abs( sx ),RY - abs( sy ) ); break; case itPRMButton: - uiMenuMouse( RX,RY ); + guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 ); break; case itPotmeter: item->value=(float)( X - item->x ) / item->width * 100.0f;
--- a/gui/ui/menu.c Fri Jan 25 11:14:11 2013 +0000 +++ b/gui/ui/menu.c Fri Jan 25 11:51:37 2013 +0000 @@ -71,15 +71,15 @@ wsImageDraw( &guiApp.menuWindow ); } -void uiMenuMouse( int RX,int RY ) +static void uiMenuMouse( int Button,int X,int Y,int RX,int RY ) { int x,y,i; if ( !guiApp.menu.Bitmap.Image ) return; menuItem=-1; - x=RX - guiApp.menuWindow.X; - y=RY - guiApp.menuWindow.Y; + x=X - guiApp.menuWindow.X; + y=Y - guiApp.menuWindow.Y; if ( ( x < 0 ) || ( y < 0 ) || ( x > guiApp.menu.width ) || ( y > guiApp.menu.height ) ) { wsWindowRedraw( &guiApp.menuWindow ); @@ -120,7 +120,7 @@ menuIsInitialized=True; guiApp.menuWindow.DrawHandler=uiMenuDraw; -// guiApp.menuWindow.MouseHandler=uiMenuMouse; + guiApp.menuWindow.MouseHandler=uiMenuMouse; // guiApp.menuWindow.KeyHandler=uiMainKey; uiMenuRender=True; wsWindowRedraw( &guiApp.menuWindow ); }
--- a/gui/ui/playbar.c Fri Jan 25 11:14:11 2013 +0000 +++ b/gui/ui/playbar.c Fri Jan 25 11:51:37 2013 +0000 @@ -211,7 +211,7 @@ switch ( itemtype ) { case itPRMButton: - uiMenuMouse( RX,RY ); + guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 ); break; case itPotmeter: item->value=(float)( X - item->x ) / item->width * 100.0f;
--- a/gui/ui/ui.h Fri Jan 25 11:14:11 2013 +0000 +++ b/gui/ui/ui.h Fri Jan 25 11:51:37 2013 +0000 @@ -39,7 +39,6 @@ void uiMenuInit( void ); void uiMenuHide( int mx, int my, int w ); void uiMenuShow( int mx, int my ); -void uiMenuMouse( int RX, int RY ); void uiPlaybarInit( void ); void uiPlaybarShow( int y );