[MPlayer-cvslog] r32999 - in trunk/gui: app.c app.h mplayer/menu.c mplayer/mw.c skin/skin.c

ib subversion at mplayerhq.hu
Wed Mar 2 17:05:38 CET 2011


Author: ib
Date: Wed Mar  2 17:05:37 2011
New Revision: 32999

Log:
Adjust the listItems structure.

Add 'main' to members referring to the main window, switch bar with menu
members and adjust the spelling of 'MenuItems' to the other 'Items'.

Modified:
   trunk/gui/app.c
   trunk/gui/app.h
   trunk/gui/mplayer/menu.c
   trunk/gui/mplayer/mw.c
   trunk/gui/skin/skin.c

Modified: trunk/gui/app.c
==============================================================================
--- trunk/gui/app.c	Wed Mar  2 16:37:50 2011	(r32998)
+++ trunk/gui/app.c	Wed Mar  2 17:05:37 2011	(r32999)
@@ -108,18 +108,18 @@ void appInitStruct(listItems *item)
 {
     int i;
 
-    for (i = 0; i < item->NumberOfItems; i++)
-        appClearItem(&item->Items[i]);
-    for (i = 0; i < item->NumberOfMenuItems; i++)
-        appClearItem(&item->MenuItems[i]);
+    for (i = 0; i < item->NumberOfMainItems; i++)
+        appClearItem(&item->mainItems[i]);
     for (i = 0; i < item->NumberOfBarItems; i++)
         appClearItem(&item->barItems[i]);
+    for (i = 0; i < item->NumberOfMenuItems; i++)
+        appClearItem(&item->menuItems[i]);
 
-    item->NumberOfItems = -1;
-    memset(item->Items, 0, 256 * sizeof(wItem));
+    item->NumberOfMainItems = -1;
+    memset(item->mainItems, 0, 256 * sizeof(wItem));
 
     item->NumberOfMenuItems = -1;
-    memset(item->MenuItems, 0, 64 * sizeof(wItem));
+    memset(item->menuItems, 0, 64 * sizeof(wItem));
 
     item->NumberOfBarItems = -1;
     memset(item->barItems, 0, 256 * sizeof(wItem));
@@ -158,12 +158,12 @@ void btnModify(int event, float state)
 {
     int i;
 
-    for (i = 0; i < appMPlayer.NumberOfItems + 1; i++) {
-        if (appMPlayer.Items[i].message == event) {
-            switch (appMPlayer.Items[i].type) {
+    for (i = 0; i < appMPlayer.NumberOfMainItems + 1; i++) {
+        if (appMPlayer.mainItems[i].message == event) {
+            switch (appMPlayer.mainItems[i].type) {
             case itButton:
-                appMPlayer.Items[i].pressed = (int)state;
-                appMPlayer.Items[i].tmp     = (int)state;
+                appMPlayer.mainItems[i].pressed = (int)state;
+                appMPlayer.mainItems[i].tmp     = (int)state;
                 break;
 
             case itPotmeter:
@@ -173,7 +173,7 @@ void btnModify(int event, float state)
                     state = 0.0;
                 if (state > 100.0)
                     state = 100.0;
-                appMPlayer.Items[i].value = state;
+                appMPlayer.mainItems[i].value = state;
                 break;
             }
         }
@@ -205,10 +205,10 @@ void btnSet(int event, int set)
 {
     int i;
 
-    for (i = 0; i < appMPlayer.NumberOfItems + 1; i++) {
-        if (appMPlayer.Items[i].message == event) {
-            appMPlayer.Items[i].pressed = set;
-            appMPlayer.barItems[i].tmp  = 0;
+    for (i = 0; i < appMPlayer.NumberOfMainItems + 1; i++) {
+        if (appMPlayer.mainItems[i].message == event) {
+            appMPlayer.mainItems[i].pressed = set;
+            appMPlayer.barItems[i].tmp      = 0;
         }
     }
 

Modified: trunk/gui/app.h
==============================================================================
--- trunk/gui/app.h	Wed Mar  2 16:37:50 2011	(r32998)
+++ trunk/gui/app.h	Wed Mar  2 17:05:37 2011	(r32999)
@@ -173,14 +173,14 @@ typedef struct {
     wsTWindow menuWindow;
     int menuIsPresent;
 
-    int NumberOfItems;
-    wItem Items[256];
-
-    int NumberOfMenuItems;
-    wItem MenuItems[64];
+    int NumberOfMainItems;
+    wItem mainItems[256];
 
     int NumberOfBarItems;
     wItem barItems[256];
+
+    int NumberOfMenuItems;
+    wItem menuItems[64];
 } listItems;
 
 extern listItems appMPlayer;

Modified: trunk/gui/mplayer/menu.c
==============================================================================
--- trunk/gui/mplayer/menu.c	Wed Mar  2 16:37:50 2011	(r32998)
+++ trunk/gui/mplayer/menu.c	Wed Mar  2 17:05:37 2011	(r32999)
@@ -52,8 +52,8 @@ static void mplMenuDraw( void )
     {
      buf=(uint32_t *)mplMenuDrawBuffer;
      drw=(uint32_t *)appMPlayer.menuSelected.Bitmap.Image;
-     for ( y=appMPlayer.MenuItems[ mplMenuItem ].y; y < appMPlayer.MenuItems[ mplMenuItem ].y + appMPlayer.MenuItems[ mplMenuItem ].height; y++ )
-       for ( x=appMPlayer.MenuItems[ mplMenuItem ].x; x < appMPlayer.MenuItems[ mplMenuItem ].x + appMPlayer.MenuItems[ mplMenuItem ].width; x++ )
+     for ( y=appMPlayer.menuItems[ mplMenuItem ].y; y < appMPlayer.menuItems[ mplMenuItem ].y + appMPlayer.menuItems[ mplMenuItem ].height; y++ )
+       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;
@@ -85,8 +85,8 @@ void mplMenuMouseHandle( int X,int Y,int
  for( i=0;i<=appMPlayer.NumberOfMenuItems;i++ )
   {
    if ( wgIsRect( x,y,
-         appMPlayer.MenuItems[i].x,appMPlayer.MenuItems[i].y,
-         appMPlayer.MenuItems[i].x+appMPlayer.MenuItems[i].width,appMPlayer.MenuItems[i].y+appMPlayer.MenuItems[i].height ) ) { mplMenuItem=i; break; }
+         appMPlayer.menuItems[i].x,appMPlayer.menuItems[i].y,
+         appMPlayer.menuItems[i].x+appMPlayer.menuItems[i].width,appMPlayer.menuItems[i].y+appMPlayer.menuItems[i].height ) ) { mplMenuItem=i; break; }
   }
  wsPostRedisplay( &appMPlayer.menuWindow );
 }
@@ -130,13 +130,13 @@ void mplHideMenu( int mx,int my,int w )
  if ( ( x < 0 ) || ( y < 0 ) ) return;
 
 // printf( "---------> %d %d,%d\n",i,x,y );
-// printf( "--------> mi: %d,%d %dx%d\n",appMPlayer.MenuItems[i].x,appMPlayer.MenuItems[i].y,appMPlayer.MenuItems[i].width,appMPlayer.MenuItems[i].height );
+// printf( "--------> mi: %d,%d %dx%d\n",appMPlayer.menuItems[i].x,appMPlayer.menuItems[i].y,appMPlayer.menuItems[i].width,appMPlayer.menuItems[i].height );
  if ( wgIsRect( x,y,
-        appMPlayer.MenuItems[i].x,appMPlayer.MenuItems[i].y,
-        appMPlayer.MenuItems[i].x+appMPlayer.MenuItems[i].width,
-        appMPlayer.MenuItems[i].y+appMPlayer.MenuItems[i].height ) )
+        appMPlayer.menuItems[i].x,appMPlayer.menuItems[i].y,
+        appMPlayer.menuItems[i].x+appMPlayer.menuItems[i].width,
+        appMPlayer.menuItems[i].y+appMPlayer.menuItems[i].height ) )
    {
-    mplEventHandling( appMPlayer.MenuItems[i].message,(float)w );
+    mplEventHandling( appMPlayer.menuItems[i].message,(float)w );
    }
 }
 

Modified: trunk/gui/mplayer/mw.c
==============================================================================
--- trunk/gui/mplayer/mw.c	Wed Mar  2 16:37:50 2011	(r32998)
+++ trunk/gui/mplayer/mw.c	Wed Mar  2 17:05:37 2011	(r32999)
@@ -88,7 +88,7 @@ void mplMainDraw( void )
    btnModify( evSetVolume,guiIntfStruct.Volume );
 
    fast_memcpy( mplDrawBuffer,appMPlayer.main.Bitmap.Image,appMPlayer.main.Bitmap.ImageSize );
-   Render( &appMPlayer.mainWindow,appMPlayer.Items,appMPlayer.NumberOfItems,mplDrawBuffer,appMPlayer.main.Bitmap.ImageSize );
+   Render( &appMPlayer.mainWindow,appMPlayer.mainItems,appMPlayer.NumberOfMainItems,mplDrawBuffer,appMPlayer.main.Bitmap.ImageSize );
    mplMainRender=0;
   }
  wsPutImage( &appMPlayer.mainWindow );
@@ -406,9 +406,9 @@ void mplMainMouseHandle( int Button,int 
  static int     SelectedItem = -1;
         int     currentselected = -1;
 
- for ( i=0;i < appMPlayer.NumberOfItems + 1;i++ )
-  if ( ( appMPlayer.Items[i].pressed != btnDisabled )&&
-       ( wgIsRect( X,Y,appMPlayer.Items[i].x,appMPlayer.Items[i].y,appMPlayer.Items[i].x+appMPlayer.Items[i].width,appMPlayer.Items[i].y+appMPlayer.Items[i].height ) ) )
+ for ( i=0;i < appMPlayer.NumberOfMainItems + 1;i++ )
+  if ( ( appMPlayer.mainItems[i].pressed != btnDisabled )&&
+       ( wgIsRect( X,Y,appMPlayer.mainItems[i].x,appMPlayer.mainItems[i].y,appMPlayer.mainItems[i].x+appMPlayer.mainItems[i].width,appMPlayer.mainItems[i].y+appMPlayer.mainItems[i].height ) ) )
    { currentselected=i; break; }
 
  switch ( Button )
@@ -428,7 +428,7 @@ void mplMainMouseHandle( int Button,int 
           SelectedItem=currentselected;
           if ( SelectedItem == -1 ) break;
           boxMoved=0;
-          item=&appMPlayer.Items[SelectedItem];
+          item=&appMPlayer.mainItems[SelectedItem];
           itemtype=item->type;
           item->pressed=btnPressed;
           switch( item->type )
@@ -443,7 +443,7 @@ void mplMainMouseHandle( int Button,int 
           break;
    case wsRLMouseButton:
           boxMoved=0;
-          item=&appMPlayer.Items[SelectedItem];
+          item=&appMPlayer.mainItems[SelectedItem];
           item->pressed=btnReleased;
           SelectedItem=-1;
           if ( currentselected == - 1 ) { itemtype=0; break; }
@@ -474,7 +474,7 @@ void mplMainMouseHandle( int Button,int 
    case wsP5MouseButton: value=-2.5f; goto rollerhandled;
    case wsP4MouseButton: value= 2.5f;
 rollerhandled:
-          item=&appMPlayer.Items[currentselected];
+          item=&appMPlayer.mainItems[currentselected];
           if ( ( item->type == itHPotmeter )||( item->type == itVPotmeter )||( item->type == itPotmeter ) )
            {
             item->value+=value;
@@ -485,7 +485,7 @@ rollerhandled:
 
 // --- moving
    case wsMoveMouse:
-          item=&appMPlayer.Items[SelectedItem];
+          item=&appMPlayer.mainItems[SelectedItem];
           switch ( itemtype )
            {
             case itPLMButton:

Modified: trunk/gui/skin/skin.c
==============================================================================
--- trunk/gui/skin/skin.c	Wed Mar  2 16:37:50 2011	(r32998)
+++ trunk/gui/skin/skin.c	Wed Mar  2 17:05:37 2011	(r32999)
@@ -186,8 +186,8 @@ static int cmd_window(char *in)
 
     if (!strncmp(in, "main", 4)) {
         currSection  = &appMPlayer.main;
-        currSubItem  = &appMPlayer.NumberOfItems;
-        currSubItems = appMPlayer.Items;
+        currSubItem  = &appMPlayer.NumberOfMainItems;
+        currSubItems = appMPlayer.mainItems;
     } else if (!strncmp(in, "sub", 3))
         currSection = &appMPlayer.sub;
     else if (!strncmp(in, "playbar", 7)) {
@@ -197,7 +197,7 @@ static int cmd_window(char *in)
     } else if (!strncmp(in, "menu", 4)) {
         currSection  = &appMPlayer.menuBase;
         currSubItem  = &appMPlayer.NumberOfMenuItems;
-        currSubItems = appMPlayer.MenuItems;
+        currSubItems = appMPlayer.menuItems;
     } else
         ERRORMESSAGE(MSGTR_UNKNOWNWINDOWTYPE);
 
@@ -453,20 +453,20 @@ static int cmd_menu(char *in)
     message = appFindMessage(tmp);
 
     defList->NumberOfMenuItems++;
-    defList->MenuItems[defList->NumberOfMenuItems].x      = x;
-    defList->MenuItems[defList->NumberOfMenuItems].y      = y;
-    defList->MenuItems[defList->NumberOfMenuItems].width  = sx;
-    defList->MenuItems[defList->NumberOfMenuItems].height = sy;
+    defList->menuItems[defList->NumberOfMenuItems].x      = x;
+    defList->menuItems[defList->NumberOfMenuItems].y      = y;
+    defList->menuItems[defList->NumberOfMenuItems].width  = sx;
+    defList->menuItems[defList->NumberOfMenuItems].height = sy;
 
     mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "\n[skin] menuitem: %d\n", defList->NumberOfMenuItems);
     mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin]  x: %d y: %d sx: %d sy: %d\n", x, y, sx, sy);
 
-    if ((defList->MenuItems[defList->NumberOfMenuItems].message = message) == -1)
+    if ((defList->menuItems[defList->NumberOfMenuItems].message = message) == -1)
         ERRORMESSAGE(MSGTR_SKIN_BITMAP_UnknownMessage, tmp);
 
-    mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin]  message: %d\n", defList->Items[defList->NumberOfItems].message);
+    mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin]  message: %d\n", defList->mainItems[defList->NumberOfMainItems].message);
 
-    defList->MenuItems[defList->NumberOfMenuItems].Bitmap.Image = NULL;
+    defList->menuItems[defList->NumberOfMenuItems].Bitmap.Image = NULL;
     return 0;
 }
 


More information about the MPlayer-cvslog mailing list