[MPlayer-cvslog] r35769 - in trunk/gui: app/gui.h ui/main.c ui/menu.c ui/playbar.c wm/ws.h

ib subversion at mplayerhq.hu
Thu Jan 17 18:11:46 CET 2013


Author: ib
Date: Thu Jan 17 18:11:46 2013
New Revision: 35769

Log:
Move wgIsRect from ws.h to gui.h.

It's not window system specific.

Additionally, rename it isInside.

Modified:
   trunk/gui/app/gui.h
   trunk/gui/ui/main.c
   trunk/gui/ui/menu.c
   trunk/gui/ui/playbar.c
   trunk/gui/wm/ws.h

Modified: trunk/gui/app/gui.h
==============================================================================
--- trunk/gui/app/gui.h	Thu Jan 17 17:53:15 2013	(r35768)
+++ trunk/gui/app/gui.h	Thu Jan 17 18:11:46 2013	(r35769)
@@ -38,4 +38,7 @@
 /// StreamTypes that are permitted in a playlist
 #define isPlaylistStreamtype (guiInfo.StreamType == STREAMTYPE_FILE || guiInfo.StreamType == STREAMTYPE_STREAM)
 
+/// check whether x/y is inside the rectangle given by top x/y and bottom x/y
+#define isInside(x, y, tx, ty, bx, by) ((x) > (tx) && (y) > (ty) && (x) < (bx) && (y) < (by))
+
 #endif /* MPLAYER_GUI_GUI_H */

Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c	Thu Jan 17 17:53:15 2013	(r35768)
+++ trunk/gui/ui/main.c	Thu Jan 17 18:11:46 2013	(r35769)
@@ -431,7 +431,7 @@ void uiMainMouseHandle( int Button,int X
 
  for ( i=0;i <= guiApp.IndexOfMainItems;i++ )
   if ( ( guiApp.mainItems[i].pressed != btnDisabled )&&
-       ( wgIsRect( X,Y,guiApp.mainItems[i].x,guiApp.mainItems[i].y,guiApp.mainItems[i].x+guiApp.mainItems[i].width,guiApp.mainItems[i].y+guiApp.mainItems[i].height ) ) )
+       ( isInside( X,Y,guiApp.mainItems[i].x,guiApp.mainItems[i].y,guiApp.mainItems[i].x+guiApp.mainItems[i].width,guiApp.mainItems[i].y+guiApp.mainItems[i].height ) ) )
    { currentselected=i; break; }
 
  switch ( Button )

Modified: trunk/gui/ui/menu.c
==============================================================================
--- trunk/gui/ui/menu.c	Thu Jan 17 17:53:15 2013	(r35768)
+++ trunk/gui/ui/menu.c	Thu Jan 17 18:11:46 2013	(r35769)
@@ -87,7 +87,7 @@ void uiMenuMouseHandle( int RX,int RY )
 
  for( i=0;i<=guiApp.IndexOfMenuItems;i++ )
   {
-   if ( wgIsRect( x,y,
+   if ( isInside( x,y,
          guiApp.menuItems[i].x,guiApp.menuItems[i].y,
          guiApp.menuItems[i].x+guiApp.menuItems[i].width,guiApp.menuItems[i].y+guiApp.menuItems[i].height ) ) { menuItem=i; break; }
   }
@@ -134,7 +134,7 @@ void uiHideMenu( int mx,int my,int w )
 
 // printf( "---------> %d %d,%d\n",i,x,y );
 // printf( "--------> mi: %d,%d %dx%d\n",guiApp.menuItems[i].x,guiApp.menuItems[i].y,guiApp.menuItems[i].width,guiApp.menuItems[i].height );
- if ( wgIsRect( x,y,
+ if ( isInside( x,y,
         guiApp.menuItems[i].x,guiApp.menuItems[i].y,
         guiApp.menuItems[i].x+guiApp.menuItems[i].width,
         guiApp.menuItems[i].y+guiApp.menuItems[i].height ) )

Modified: trunk/gui/ui/playbar.c
==============================================================================
--- trunk/gui/ui/playbar.c	Thu Jan 17 17:53:15 2013	(r35768)
+++ trunk/gui/ui/playbar.c	Thu Jan 17 18:11:46 2013	(r35769)
@@ -127,7 +127,7 @@ static void uiPlaybarMouseHandle( int Bu
 
  for ( i=0;i <= guiApp.IndexOfPlaybarItems;i++ )
    if ( ( guiApp.playbarItems[i].pressed != btnDisabled )&&
-      ( wgIsRect( X,Y,guiApp.playbarItems[i].x,guiApp.playbarItems[i].y,guiApp.playbarItems[i].x+guiApp.playbarItems[i].width,guiApp.playbarItems[i].y+guiApp.playbarItems[i].height ) ) )
+      ( isInside( X,Y,guiApp.playbarItems[i].x,guiApp.playbarItems[i].y,guiApp.playbarItems[i].x+guiApp.playbarItems[i].width,guiApp.playbarItems[i].y+guiApp.playbarItems[i].height ) ) )
     { currentselected=i; break; }
 
  switch ( Button )

Modified: trunk/gui/wm/ws.h
==============================================================================
--- trunk/gui/wm/ws.h	Thu Jan 17 17:53:15 2013	(r35768)
+++ trunk/gui/wm/ws.h	Thu Jan 17 18:11:46 2013	(r35769)
@@ -213,6 +213,4 @@ void wsPutImage(wsWindow *win);
 void wsResizeImage(wsWindow *win, int Width, int Height);
 void wsDestroyImage(wsWindow *win);
 
-#define wgIsRect(X, Y, tX, tY, bX, bY) (((X) > (tX)) && ((Y) > (tY)) && ((X) < (bX)) && ((Y) < (bY)))
-
 #endif /* MPLAYER_GUI_WS_H */


More information about the MPlayer-cvslog mailing list