changeset 33084:b8779b19730e

Cosmetic: Rename menuBase menu. The new name corresponds better to the names of the other wItems and statements using it are more intelligible.
author ib
date Thu, 31 Mar 2011 12:25:32 +0000
parents 8c96263e0f09
children ae558e6f7a57
files gui/app.c gui/app.h gui/mplayer/menu.c gui/mplayer/play.c gui/skin/skin.c
diffstat 5 files changed, 29 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/gui/app.c	Thu Mar 31 12:03:54 2011 +0000
+++ b/gui/app.c	Thu Mar 31 12:25:32 2011 +0000
@@ -106,7 +106,7 @@
     appClearItem(&appMPlayer.bar);
     appMPlayer.barIsPresent = 0;
 
-    appClearItem(&appMPlayer.menuBase);
+    appClearItem(&appMPlayer.menu);
     appClearItem(&appMPlayer.menuSelected);
     appMPlayer.menuIsPresent = 0;
 
--- a/gui/app.h	Thu Mar 31 12:03:54 2011 +0000
+++ b/gui/app.h	Thu Mar 31 12:25:32 2011 +0000
@@ -175,7 +175,7 @@
     wsTWindow barWindow;
     int barIsPresent;
 
-    wItem menuBase;
+    wItem menu;
     wItem menuSelected;
     wsTWindow menuWindow;
     int menuIsPresent;
--- a/gui/mplayer/menu.c	Thu Mar 31 12:03:54 2011 +0000
+++ b/gui/mplayer/menu.c	Thu Mar 31 12:25:32 2011 +0000
@@ -41,12 +41,12 @@
  uint32_t * drw = NULL;
  int             x,y,tmp;
 
- if ( !appMPlayer.menuIsPresent || !appMPlayer.menuBase.Bitmap.Image ) return;
+ if ( !appMPlayer.menuIsPresent || !appMPlayer.menu.Bitmap.Image ) return;
  if ( !mplMenuRender && !appMPlayer.menuWindow.Visible ) return;
 
  if ( mplMenuRender || mplMenuItem != mplOldMenuItem )
   {
-   memcpy( mplMenuDrawBuffer,appMPlayer.menuBase.Bitmap.Image,appMPlayer.menuBase.Bitmap.ImageSize );
+   memcpy( mplMenuDrawBuffer,appMPlayer.menu.Bitmap.Image,appMPlayer.menu.Bitmap.ImageSize );
 // ---
    if ( mplMenuItem != -1 )
     {
@@ -56,12 +56,12 @@
        for ( x=appMPlayer.menuItems[ mplMenuItem ].x; x < appMPlayer.menuItems[ mplMenuItem ].x + appMPlayer.menuItems[ mplMenuItem ].width; x++ )
          {
           tmp=drw[ y * appMPlayer.menuSelected.width + x ];
-          if ( tmp != 0x00ff00ff ) buf[ y * appMPlayer.menuBase.width + x ]=tmp;
+          if ( tmp != 0x00ff00ff ) buf[ y * appMPlayer.menu.width + x ]=tmp;
          }
     }
    mplOldMenuItem=mplMenuItem;
 // ---
-   wsConvert( &appMPlayer.menuWindow,mplMenuDrawBuffer,appMPlayer.menuBase.Bitmap.ImageSize );
+   wsConvert( &appMPlayer.menuWindow,mplMenuDrawBuffer,appMPlayer.menu.Bitmap.ImageSize );
    mplMenuRender=0;
   }
  wsPutImage( &appMPlayer.menuWindow );
@@ -71,12 +71,12 @@
 {
  int x,y,i;
 
- if ( !appMPlayer.menuBase.Bitmap.Image ) return;
+ if ( !appMPlayer.menu.Bitmap.Image ) return;
 
  mplMenuItem=-1;
  x=RX - appMPlayer.menuWindow.X;
  y=RY - appMPlayer.menuWindow.Y;
- if ( ( x < 0 ) || ( y < 0  ) || ( x > appMPlayer.menuBase.width ) || ( y > appMPlayer.menuBase.height ) )
+ if ( ( x < 0 ) || ( y < 0  ) || ( x > appMPlayer.menu.width ) || ( y > appMPlayer.menu.height ) )
   {
    wsPostRedisplay( &appMPlayer.menuWindow );
    return;
@@ -95,7 +95,7 @@
 {
  int x,y;
 
- if ( !appMPlayer.menuIsPresent || !appMPlayer.menuBase.Bitmap.Image ) return;
+ if ( !appMPlayer.menuIsPresent || !appMPlayer.menu.Bitmap.Image ) return;
 
  x=mx;
  if ( x + appMPlayer.menuWindow.Width > wsMaxX ) x=wsMaxX - appMPlayer.menuWindow.Width - 1 + wsOrgX;
@@ -118,7 +118,7 @@
 {
  int x,y,i=mplMenuItem;
 
- if ( !appMPlayer.menuIsPresent || !appMPlayer.menuBase.Bitmap.Image ) return;
+ if ( !appMPlayer.menuIsPresent || !appMPlayer.menu.Bitmap.Image ) return;
 
  x=mx-mplMenuX;
  y=my-mplMenuY;
@@ -143,12 +143,12 @@
 void mplMenuInit( void )
 {
 
- if ( mplMenuIsInitialized || !appMPlayer.menuIsPresent || !appMPlayer.menuBase.Bitmap.Image ) return;
+ if ( mplMenuIsInitialized || !appMPlayer.menuIsPresent || !appMPlayer.menu.Bitmap.Image ) return;
 
- appMPlayer.menuBase.x=0;
- appMPlayer.menuBase.y=0;
+ appMPlayer.menu.x=0;
+ appMPlayer.menu.y=0;
 
- if ( ( mplMenuDrawBuffer = calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL )
+ if ( ( mplMenuDrawBuffer = calloc( 1,appMPlayer.menu.Bitmap.ImageSize ) ) == NULL )
   {
 #ifdef DEBUG
     mp_msg( MSGT_GPLAYER,MSGL_DBG2,MSGTR_NEMFMR );
@@ -158,10 +158,10 @@
   }
 
  wsCreateWindow( &appMPlayer.menuWindow,
- appMPlayer.menuBase.x,appMPlayer.menuBase.y,appMPlayer.menuBase.width,appMPlayer.menuBase.height,
+ appMPlayer.menu.x,appMPlayer.menu.y,appMPlayer.menu.width,appMPlayer.menu.height,
  wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsOverredirect|wsHideFrame|wsMaxSize|wsMinSize|wsHideWindow,"MPlayer menu" );
 
- wsSetShape( &appMPlayer.menuWindow,appMPlayer.menuBase.Mask.Image );
+ wsSetShape( &appMPlayer.menuWindow,appMPlayer.menu.Mask.Image );
 
 #ifdef DEBUG
   mp_msg( MSGT_GPLAYER,MSGL_DBG2,"menu: 0x%x\n",(int)appMPlayer.menuWindow.WindowID );
--- a/gui/mplayer/play.c	Thu Mar 31 12:03:54 2011 +0000
+++ b/gui/mplayer/play.c	Thu Mar 31 12:25:32 2011 +0000
@@ -214,16 +214,16 @@
 
     if (prev && appMPlayer.menuIsPresent) {
         free(mplMenuDrawBuffer);
-        mplMenuDrawBuffer = calloc(1, appMPlayer.menuBase.Bitmap.ImageSize);
+        mplMenuDrawBuffer = calloc(1, appMPlayer.menu.Bitmap.ImageSize);
 
         if (!mplMenuDrawBuffer) {
             mp_msg(MSGT_GPLAYER, MSGL_STATUS, MSGTR_NEMDB);
             return;
         }
 
-        wsResizeWindow(&appMPlayer.menuWindow, appMPlayer.menuBase.width, appMPlayer.menuBase.height);
-        wsResizeImage(&appMPlayer.menuWindow, appMPlayer.menuBase.width, appMPlayer.menuBase.height);
-        wsSetShape(&appMPlayer.menuWindow, appMPlayer.menuBase.Mask.Image);
+        wsResizeWindow(&appMPlayer.menuWindow, appMPlayer.menu.width, appMPlayer.menu.height);
+        wsResizeImage(&appMPlayer.menuWindow, appMPlayer.menu.width, appMPlayer.menu.height);
+        wsSetShape(&appMPlayer.menuWindow, appMPlayer.menu.Mask.Image);
         wsVisibleWindow(&appMPlayer.menuWindow, wsHideWindow);
     } else
         mplMenuInit();
--- a/gui/skin/skin.c	Thu Mar 31 12:03:54 2011 +0000
+++ b/gui/skin/skin.c	Thu Mar 31 12:25:32 2011 +0000
@@ -194,7 +194,7 @@
         currWinItemIdx = &appMPlayer.IndexOfBarItems;
         currWinItems   = appMPlayer.barItems;
     } else if (strcmp(in, "menu") == 0) {
-        currWin = &appMPlayer.menuBase;
+        currWin = &appMPlayer.menu;
         currWinItemIdx = &appMPlayer.IndexOfMenuItems;
         currWinItems   = appMPlayer.menuItems;
     } else {
@@ -280,24 +280,24 @@
         mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin]    image: %s\n", fname);
 
         skin->menuIsPresent = 1;
-        skin->menuBase.type = itBase;
+        skin->menu.type     = itBase;
 
         av_strlcpy(tmp, path, sizeof(tmp));
         av_strlcat(tmp, fname, sizeof(tmp));
 
-        if (skinBPRead(tmp, &skin->menuBase.Bitmap) != 0)
+        if (skinBPRead(tmp, &skin->menu.Bitmap) != 0)
             return 1;
 
-        skin->menuBase.width  = skin->menuBase.Bitmap.Width;
-        skin->menuBase.height = skin->menuBase.Bitmap.Height;
+        skin->menu.width  = skin->menu.Bitmap.Width;
+        skin->menu.height = skin->menu.Bitmap.Height;
 
-        mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin]     bitmap: %dx%d\n", skin->menuBase.width, skin->menuBase.height);
+        mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin]     bitmap: %dx%d\n", skin->menu.width, skin->menu.height);
 
 #ifdef CONFIG_XSHAPE
-        Convert32to1(&skin->menuBase.Bitmap, &skin->menuBase.Mask, 0x00ff00ff);
-        mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin]     mask: %lux%lu\n", skin->menuBase.Mask.Width, skin->menuBase.Mask.Height);
+        Convert32to1(&skin->menu.Bitmap, &skin->menu.Mask, 0x00ff00ff);
+        mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin]     mask: %lux%lu\n", skin->menu.Mask.Width, skin->menu.Mask.Height);
 #else
-        skin->menuBase.Mask.Image = NULL;
+        skin->menu.Mask.Image = NULL;
 #endif
     }