[MPlayer-cvslog] r35872 - in trunk/gui/ui: main.c menu.c playbar.c ui.h video.c

ib subversion at mplayerhq.hu
Fri Jan 25 12:51:37 CET 2013


Author: ib
Date: Fri Jan 25 12:51:37 2013
New Revision: 35872

Log:
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.

Modified:
   trunk/gui/ui/main.c
   trunk/gui/ui/menu.c
   trunk/gui/ui/playbar.c
   trunk/gui/ui/ui.h
   trunk/gui/ui/video.c

Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c	Fri Jan 25 12:14:11 2013	(r35871)
+++ trunk/gui/ui/main.c	Fri Jan 25 12:51:37 2013	(r35872)
@@ -189,7 +189,7 @@ rollerhandled:
                  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;

Modified: trunk/gui/ui/menu.c
==============================================================================
--- trunk/gui/ui/menu.c	Fri Jan 25 12:14:11 2013	(r35871)
+++ trunk/gui/ui/menu.c	Fri Jan 25 12:51:37 2013	(r35872)
@@ -71,15 +71,15 @@ static void uiMenuDraw( void )
  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 @@ void uiMenuInit( void )
 
  menuIsInitialized=True;
  guiApp.menuWindow.DrawHandler=uiMenuDraw;
-// guiApp.menuWindow.MouseHandler=uiMenuMouse;
+ guiApp.menuWindow.MouseHandler=uiMenuMouse;
 // guiApp.menuWindow.KeyHandler=uiMainKey;
  uiMenuRender=True; wsWindowRedraw( &guiApp.menuWindow );
 }

Modified: trunk/gui/ui/playbar.c
==============================================================================
--- trunk/gui/ui/playbar.c	Fri Jan 25 12:14:11 2013	(r35871)
+++ trunk/gui/ui/playbar.c	Fri Jan 25 12:51:37 2013	(r35872)
@@ -211,7 +211,7 @@ rollerhandled:
 	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;

Modified: trunk/gui/ui/ui.h
==============================================================================
--- trunk/gui/ui/ui.h	Fri Jan 25 12:14:11 2013	(r35871)
+++ trunk/gui/ui/ui.h	Fri Jan 25 12:51:37 2013	(r35872)
@@ -39,7 +39,6 @@ void uiVideoMouse( int Button, int X, in
 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 );

Modified: trunk/gui/ui/video.c
==============================================================================
--- trunk/gui/ui/video.c	Fri Jan 25 12:14:11 2013	(r35871)
+++ trunk/gui/ui/video.c	Fri Jan 25 12:51:37 2013	(r35872)
@@ -89,7 +89,7 @@ void uiVideoMouse( int Button,int X,int 
                     }
                    break;
             case wsPMMouseButton:
-                   uiMenuMouse( RX,RY );
+                   guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 );
                    break;
 	    default: uiPlaybarShow( Y ); break;
            }


More information about the MPlayer-cvslog mailing list