comparison Gui/interface.c @ 9202:c2f31ca14a92

- rewrite Jan Spitalnik's patch - fix some nice 10l
author pontscho
date Sat, 01 Feb 2003 16:42:02 +0000
parents 731e5dc57436
children 64b8c5a07c2c
comparison
equal deleted inserted replaced
9201:419d7ccb0f3b 9202:c2f31ca14a92
191 if ( ( mplDrawBuffer = (unsigned char *)malloc( appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) 191 if ( ( mplDrawBuffer = (unsigned char *)malloc( appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
192 { 192 {
193 fprintf( stderr,MSGTR_NEMDB ); 193 fprintf( stderr,MSGTR_NEMDB );
194 exit( 0 ); 194 exit( 0 );
195 } 195 }
196 196
197 wsCreateWindow( &appMPlayer.subWindow, 197 wsCreateWindow( &appMPlayer.subWindow,
198 appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height, 198 appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height,
199 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"ViDEO" ); 199 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"MPlayer - Video" );
200 200
201 wsDestroyImage( &appMPlayer.subWindow ); 201 wsDestroyImage( &appMPlayer.subWindow );
202 wsCreateImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); 202 wsCreateImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height );
203 wsXDNDMakeAwareness(&appMPlayer.subWindow); 203 wsXDNDMakeAwareness(&appMPlayer.subWindow);
204 204
247 guiIntfStruct.Playing=0; 247 guiIntfStruct.Playing=0;
248 248
249 if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 ); 249 if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 );
250 250
251 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); 251 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
252 #if 1 252 #if 0
253 wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); 253 wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
254 254
255 { 255 {
256 XEvent xev; 256 XEvent xev;
257 do { XNextEvent( wsDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID ); 257 do { XNextEvent( wsDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID );
262 if ( fullscreen ) 262 if ( fullscreen )
263 { 263 {
264 mplFullScreen(); 264 mplFullScreen();
265 btnModify( evFullScreen,btnPressed ); 265 btnModify( evFullScreen,btnPressed );
266 } 266 }
267 #else
268 if ( gtkShowVideoWindow )
269 {
270 wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
271 {
272 XEvent xev;
273 do { XNextEvent( wsDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID );
274 appMPlayer.subWindow.Mapped=wsMapped;
275 }
276
277 if ( fullscreen )
278 {
279 mplFullScreen();
280 btnModify( evFullScreen,btnPressed );
281 }
282 }
283 else
284 {
285 if ( fullscreen )
286 {
287 wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
288 {
289 XEvent xev;
290 do { XNextEvent( wsDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID );
291 appMPlayer.subWindow.Mapped=wsMapped;
292 }
293 wsVisibleWindow( &appMPlayer.subWindow, wsShowWindow );
294
295 mplFullScreen();
296 btnModify( evFullScreen,btnPressed );
297 }
298 }
267 #endif 299 #endif
268 mplSubRender=1; 300 mplSubRender=1;
269 // --- 301 // ---
270 302
271 if ( filename ) mplSetFileName( NULL,filename,STREAMTYPE_FILE ); 303 if ( filename ) mplSetFileName( NULL,filename,STREAMTYPE_FILE );
440 gtkEventHandling(); 472 gtkEventHandling();
441 break; 473 break;
442 case guiCEvent: 474 case guiCEvent:
443 switch ( (int)arg ) 475 switch ( (int)arg )
444 { 476 {
445 case guiSetPlay: guiIntfStruct.Playing=1; break; 477 case guiSetPlay:
446 case guiSetStop: guiIntfStruct.Playing=0; break; 478 guiIntfStruct.Playing=1;
479 if ( !gtkShowVideoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
480 break;
481 case guiSetStop:
482 guiIntfStruct.Playing=0;
483 if ( !gtkShowVideoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
484 break;
447 case guiSetPause: guiIntfStruct.Playing=2; break; 485 case guiSetPause: guiIntfStruct.Playing=2; break;
448 } 486 }
449 mplState(); 487 mplState();
450 break; 488 break;
451 case guiSetState: 489 case guiSetState: