comparison Gui/mplayer/play.c @ 8949:d07ab8e088a9

correct skin changing (fix one critical bug)
author pontscho
date Mon, 13 Jan 2003 23:38:49 +0000
parents b8c271750450
children 0a665389cf2b
comparison
equal deleted inserted replaced
8948:37bd5319cc21 8949:d07ab8e088a9
189 listItems tmpList; 189 listItems tmpList;
190 190
191 void ChangeSkin( char * name ) 191 void ChangeSkin( char * name )
192 { 192 {
193 int ret; 193 int ret;
194 int prev = appMPlayer.menuIsPresent;
194 195
195 mainVisible=0; 196 mainVisible=0;
196 197
197 appInitStruct( &tmpList ); 198 appInitStruct( &tmpList );
198 skinAppMPlayer=&tmpList; 199 skinAppMPlayer=&tmpList;
206 if ( skinRead( name ) ) 207 if ( skinRead( name ) )
207 { 208 {
208 mainVisible=1; 209 mainVisible=1;
209 return; 210 return;
210 } 211 }
211 if ( appMPlayer.menuBase.Bitmap.Image ) 212
213 if ( prev && appMPlayer.menuIsPresent )
212 { 214 {
213 if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer ); 215 if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer );
214 if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL ) 216 if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL )
215 { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; } 217 { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; }
216 wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); 218 wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
217 wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); 219 wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
218 wsSetShape( &appMPlayer.menuWindow,appMPlayer.menuBase.Mask.Image ); 220 wsSetShape( &appMPlayer.menuWindow,appMPlayer.menuBase.Mask.Image );
219 wsVisibleWindow( &appMPlayer.menuWindow,wsHideWindow ); 221 wsVisibleWindow( &appMPlayer.menuWindow,wsHideWindow );
220 } 222 } else { mplMenuInit(); }
221 223
222 if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); 224 if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height );
223 if ( ( !appMPlayer.subWindow.isFullScreen )&&( !guiIntfStruct.Playing ) ) 225 if ( ( !appMPlayer.subWindow.isFullScreen )&&( !guiIntfStruct.Playing ) )
224 { 226 {
225 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); 227 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
236 238
237 if ( mplDrawBuffer ) free( mplDrawBuffer ); 239 if ( mplDrawBuffer ) free( mplDrawBuffer );
238 if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) 240 if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
239 { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; } 241 { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; }
240 242
241 if ( vo_wm_type == vo_wm_Unknown ) wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow ); 243 #if 0
244 // if ( vo_wm_type == vo_wm_Unknown )
245 wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow );
242 wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); 246 wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
243 wsMoveWindow( &appMPlayer.mainWindow,True,appMPlayer.main.x,appMPlayer.main.y ); 247 wsMoveWindow( &appMPlayer.mainWindow,True,appMPlayer.main.x,appMPlayer.main.y );
244 wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); 248 wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
245 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); 249 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
246 wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration ); 250 wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration );
247 mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow ); 251 mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
248 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); 252 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
249 253 #else
254 wsDestroyWindow( &appMPlayer.mainWindow );
255
256 wsCreateWindow( &appMPlayer.mainWindow,
257 appMPlayer.main.x,appMPlayer.main.y,appMPlayer.main.width,appMPlayer.main.height,
258 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsMaxSize|wsHideWindow,"MPlayer" );
259 wsCreateImage( &appMPlayer.mainWindow,appMPlayer.main.Bitmap.Width,appMPlayer.main.Bitmap.Height );
260 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
261 wsSetIcon( wsDisplay,appMPlayer.mainWindow.WindowID,guiIcon,guiIconMask );
262
263 appMPlayer.mainWindow.ReDraw=(void *)mplMainDraw;
264 appMPlayer.mainWindow.MouseHandler=mplMainMouseHandle;
265 appMPlayer.mainWindow.KeyHandler=mplMainKeyHandle;
266 appMPlayer.mainWindow.DandDHandler=mplDandDHandler;
267
268 wsXDNDMakeAwareness( &appMPlayer.mainWindow );
269 if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 );
270 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
271 mainVisible=1;
272 #endif
250 btnModify( evSetVolume,guiIntfStruct.Volume ); 273 btnModify( evSetVolume,guiIntfStruct.Volume );
251 btnModify( evSetBalance,guiIntfStruct.Balance ); 274 btnModify( evSetBalance,guiIntfStruct.Balance );
252 btnModify( evSetMoviePosition,guiIntfStruct.Position ); 275 btnModify( evSetMoviePosition,guiIntfStruct.Position );
253 btnModify( evFullScreen,!appMPlayer.subWindow.isFullScreen ); 276 btnModify( evFullScreen,!appMPlayer.subWindow.isFullScreen );
254 } 277 }