Mercurial > mplayer.hg
changeset 32912:ca4d3fa55e43
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'.
author | ib |
---|---|
date | Wed, 02 Mar 2011 16:05:37 +0000 |
parents | e06fbdd8eb46 |
children | d971fcdbb787 |
files | gui/app.c gui/app.h gui/mplayer/menu.c gui/mplayer/mw.c gui/skin/skin.c |
diffstat | 5 files changed, 49 insertions(+), 49 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/app.c Wed Mar 02 15:37:50 2011 +0000 +++ b/gui/app.c Wed Mar 02 16:05:37 2011 +0000 @@ -108,18 +108,18 @@ { 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 @@ { 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 @@ 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 @@ { 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; } }
--- a/gui/app.h Wed Mar 02 15:37:50 2011 +0000 +++ b/gui/app.h Wed Mar 02 16:05:37 2011 +0000 @@ -173,14 +173,14 @@ 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;
--- a/gui/mplayer/menu.c Wed Mar 02 15:37:50 2011 +0000 +++ b/gui/mplayer/menu.c Wed Mar 02 16:05:37 2011 +0000 @@ -52,8 +52,8 @@ { 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 @@ 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 @@ 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 ); } }
--- a/gui/mplayer/mw.c Wed Mar 02 15:37:50 2011 +0000 +++ b/gui/mplayer/mw.c Wed Mar 02 16:05:37 2011 +0000 @@ -88,7 +88,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ // --- moving case wsMoveMouse: - item=&appMPlayer.Items[SelectedItem]; + item=&appMPlayer.mainItems[SelectedItem]; switch ( itemtype ) { case itPLMButton:
--- a/gui/skin/skin.c Wed Mar 02 15:37:50 2011 +0000 +++ b/gui/skin/skin.c Wed Mar 02 16:05:37 2011 +0000 @@ -186,8 +186,8 @@ 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 @@ } 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 @@ 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; }