Mercurial > mplayer.hg
changeset 1823:a6c67352ccac
fix some bug.
author | pontscho |
---|---|
date | Sat, 01 Sep 2001 17:53:07 +0000 |
parents | 85dda3b18445 |
children | 33035a1d897e |
files | Gui/app.c Gui/events.c Gui/events.h Gui/mplayer/gtk/fs.h Gui/mplayer/menu.h Gui/mplayer/mixer.c Gui/mplayer/mplayer.c Gui/mplayer/mw.h Gui/mplayer/play.h Gui/mplayer/sw.h Gui/wm/ws.c Gui/wm/ws.h |
diffstat | 12 files changed, 53 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/Gui/app.c Sat Sep 01 15:49:31 2001 +0000 +++ b/Gui/app.c Sat Sep 01 17:53:07 2001 +0000 @@ -72,8 +72,9 @@ appClearItem( &item->main ); appClearItem( &item->sub ); - item->sub.Bitmap.Width=256; item->sub.Bitmap.Height=256; - item->sub.width=256; item->sub.height=256; + item->sub.Bitmap.Width=384; item->sub.Bitmap.Height=384; + item->sub.width=384; item->sub.height=384; + item->sub.x=-1; item->sub.y=-1; appClearItem( &item->menuBase ); appClearItem( &item->menuSelected ); item->subR=0; @@ -104,27 +105,14 @@ printf("SKIN dir 1: '%s'\n",skinDirInHome); printf("SKIN dir 2: '%s'\n",skinMPlayerDir); -// if ( ( appMPlayerDirInHome=(char *)calloc( 1,strlen( getenv( "HOME" ) ) + 9 ) ) != NULL ) -// { strcpy( appMPlayerDirInHome,getenv( "HOME" ) ); strcat( appMPlayerDirInHome,"/.mplayer" ); } -// if ( ( skinDirInHome=(char *)calloc( 1,strlen( appMPlayerDirInHome ) + 5 ) ) != NULL ) -// { strcpy( skinDirInHome,appMPlayerDirInHome ); strcat( skinDirInHome,"/Skin" ); } -// if ( ( appMPlayerDir=(char *)calloc( 1,strlen( PREFIX ) + 14 ) ) != NULL ) -// { strcpy( appMPlayerDir,PREFIX ); strcat( appMPlayerDir,"/share/mplayer" ); } -// if ( ( skinMPlayerDir=(char *)calloc( 1,strlen( appMPlayerDir ) + 5 ) ) != NULL ) -// { strcpy( skinMPlayerDir,appMPlayerDir ); strcat( skinMPlayerDir,"/Skin" ); } - initDebug(NULL); // write messages to stderr cfgDefaults(); // set skin to "default" cfgRead(); // empty function - NOP -// if ( !strcmp( cfgAppName,"movieplayer" ) ) -// { - appMPlayer.sub.x=-1; appMPlayer.sub.y=-1; appMPlayer.sub.width=512; appMPlayer.sub.height=256; - switch ( skinRead( cfgSkin ) ) - { - case -1: dbprintf( 0,"[app] skin configfile not found.\n" ); exit( 0 ); - case -2: dbprintf( 0,"[app] skin configfile read error.\n" ); exit( 0 ); - } - mplInit( argc,argv,envp,disp ); // does gtk & ws initialization, create windows -// } + switch ( skinRead( cfgSkin ) ) + { + case -1: dbprintf( 0,"[app] skin configfile not found.\n" ); exit( 0 ); + case -2: dbprintf( 0,"[app] skin configfile read error.\n" ); exit( 0 ); + } + mplInit( argc,argv,envp,disp ); // does gtk & ws initialization, create windows }
--- a/Gui/events.c Sat Sep 01 15:49:31 2001 +0000 +++ b/Gui/events.c Sat Sep 01 17:53:07 2001 +0000 @@ -40,7 +40,8 @@ { evDoubleSize, "evDoubleSize" }, // 38 { evSetMoviePosition, "evSetMoviePosition" }, // 39 { evSetVolume, "evSetVolume" }, // 40 - { evSetBalance, "evSetBalance" } // 41 + { evSetBalance, "evSetBalance" }, // 41 + { evHelp, "evHelp" } }; const int evBoxs = sizeof( evNames ) / sizeof( evName );
--- a/Gui/events.h Sat Sep 01 15:49:31 2001 +0000 +++ b/Gui/events.h Sat Sep 01 17:53:07 2001 +0000 @@ -41,6 +41,8 @@ #define evSetVolume 36 #define evSetBalance 37 +#define evHelp 38 + #define evExit 1000 // --- General events ---
--- a/Gui/mplayer/gtk/fs.h Sat Sep 01 15:49:31 2001 +0000 +++ b/Gui/mplayer/gtk/fs.h Sat Sep 01 17:53:07 2001 +0000 @@ -257,6 +257,7 @@ break; } strcpy( gtkShMem->fs.dir,fsSelectedDirectory ); +printf( "----gtk---> filname: %s\n",fsSelectedFile ); strcpy( gtkShMem->fs.filename,fsSelectedFile ); item=fsTopList_items; while( item )
--- a/Gui/mplayer/menu.h Sat Sep 01 15:49:31 2001 +0000 +++ b/Gui/mplayer/menu.h Sat Sep 01 17:53:07 2001 +0000 @@ -55,11 +55,11 @@ return; } - for( i=0;i<appMPlayer.NumberOfMenuItems+1;i++ ) + 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; + appMPlayer.MenuItems[i].x+appMPlayer.MenuItems[i].width,appMPlayer.MenuItems[i].y+appMPlayer.MenuItems[i].height ) ) { mplMenuItem=i; break; } } wsPostRedisplay( &appMPlayer.menuWindow ); } @@ -92,11 +92,15 @@ x=mx-mplMenuX; y=my-mplMenuY; +// x=RX - appMPlayer.menuWindow.X; +// y=RY - appMPlayer.menuWindow.Y; wsVisibleWindow( &appMPlayer.menuWindow,wsHideWindow ); 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 ); if ( wgIsRect( x,y, appMPlayer.MenuItems[i].x,appMPlayer.MenuItems[i].y, appMPlayer.MenuItems[i].x+appMPlayer.MenuItems[i].width,
--- a/Gui/mplayer/mixer.c Sat Sep 01 15:49:31 2001 +0000 +++ b/Gui/mplayer/mixer.c Sat Sep 01 17:53:07 2001 +0000 @@ -10,7 +10,7 @@ float mixerGetVolume( void ) { - mplShMem->Volume=mixer_getbothvolume(); +// mplShMem->Volume=(float)mixer_getbothvolume(); return mplShMem->Volume; } @@ -22,13 +22,13 @@ void mixerIncVolume( void ) { - mixer_incvolume(); +// mixer_incvolume(); mixerGetVolume(); } void mixerDecVolume( void ) { - mixer_decvolume(); +// mixer_decvolume(); mixerGetVolume(); }
--- a/Gui/mplayer/mplayer.c Sat Sep 01 15:49:31 2001 +0000 +++ b/Gui/mplayer/mplayer.c Sat Sep 01 17:53:07 2001 +0000 @@ -52,8 +52,6 @@ void mplInit( int argc,char* argv[], char *envp[], void* disp ) { -// parse_cfgfiles( argc,argv,envp ); - // allocates shmem to gtkShMem // fork() a process which runs gtkThreadProc() [gtkPID] gtkInit( argc,argv,envp );
--- a/Gui/mplayer/mw.h Sat Sep 01 15:49:31 2001 +0000 +++ b/Gui/mplayer/mw.h Sat Sep 01 17:53:07 2001 +0000 @@ -91,6 +91,7 @@ case 'V': sprintf( tmp,"%3.1f",mplShMem->Volume ); strcat( trbuf,tmp ); break; case 'b': sprintf( tmp,"%3.2f%%",mplShMem->Balance ); strcat( trbuf,tmp ); break; case 'B': sprintf( tmp,"%3.1f",mplShMem->Balance ); strcat( trbuf,tmp ); break; + case 'd': sprintf( tmp,"%d",mplShMem->FrameDrop ); strcat( trbuf,tmp ); break; case 's': if ( mplShMem->Playing == 0 ) strcat( trbuf,"s" ); break; case 'l': if ( mplShMem->Playing == 1 ) strcat( trbuf,"p" ); break; case 'e': if ( mplShMem->Playing == 2 ) strcat( trbuf,"e" ); break;
--- a/Gui/mplayer/play.h Sat Sep 01 15:49:31 2001 +0000 +++ b/Gui/mplayer/play.h Sat Sep 01 17:53:07 2001 +0000 @@ -46,6 +46,7 @@ int StreamType; int TimeSec; int LengthInSec; + int FrameDrop; char Filename[4096]; int FilenameChanged;
--- a/Gui/mplayer/sw.h Sat Sep 01 15:49:31 2001 +0000 +++ b/Gui/mplayer/sw.h Sat Sep 01 17:53:07 2001 +0000 @@ -35,7 +35,6 @@ for (i=0; i < nchilds; i++) if ( childs[i]==me ) break; for ( ;i<nchilds;i++ ) if ( childs[i] == mainw ) visible=1; -// printf( "-----------> visible main vindov: %d ---\n",visible ); return visible; } @@ -45,6 +44,10 @@ void mplSubDraw( wsParamDisplay ) { +// mainisvisible1=VisibleMainWindow(); +// printf( "--------> main: %d ---\n",mainisvisible1 ); + + // if ( ( appMPlayer.subWindow.Visible == wsWindowNotVisible )|| // ( appMPlayer.subWindow.State != wsWindowExpose ) ) return; @@ -67,6 +70,7 @@ XFlush( wsDisplay ); } appMPlayer.subWindow.State=0; +// mainis=0; } void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) @@ -89,9 +93,7 @@ break; // --- case wsPLMouseButton: - oldmainisvisible=VisibleMainWindow(); - printf( "----> %d %d\n",mainisvisible1,mainisvisible2 ); - //=mainisvisible; +//mainis=0; sx=X; sy=Y; msButton=wsPLMouseButton; mplSubMoved=0; @@ -110,6 +112,15 @@ } break; case wsRLMouseButton: +// if ( ( appMPlayer.subWindow.Focused == 0 && appMPlayer.subWindow.OFocused == 2 ) ) +// ( appMPlayer.mainWindow.Focused == 0 && appMPlayer.mainWindow.OFocused == 2 ) ) +// if ( ( !mplSubMoved )&&( !appMPlayer.mainWindow.Focused ) ) +printf( "-----> mainis: %d ---- \n",mainis ); +if ( !mainis ) +{ +wsMoveTopWindow( &appMPlayer.mainWindow ); +} +/* if ( ( !mplSubMoved )&& ( appMPlayer.subWindow.isFullScreen )&& ( !VisibleMainWindow() ) ) @@ -117,6 +128,7 @@ wsMoveTopWindow( &appMPlayer.mainWindow ); // else wsMoveTopWindow( &appMPlayer.mainWindow ); } +*/ msButton=0; mplSubMoved=0; break;
--- a/Gui/wm/ws.c Sat Sep 01 15:49:31 2001 +0000 +++ b/Gui/wm/ws.c Sat Sep 01 17:53:07 2001 +0000 @@ -439,6 +439,7 @@ win->Visible=0; win->Focused=0; + win->OFocused=0; win->Mapped=0; win->Rolled=0; if ( D & wsShowWindow ) XMapWindow( wsDisplay,win->WindowID ); @@ -481,6 +482,7 @@ win->KeyHandler=NULL; win->Visible=0; win->Focused=0; + win->OFocused=0; win->Mapped=0; win->Rolled=0; } @@ -528,10 +530,16 @@ case UnmapNotify: i=wsWindowUnmapped; wsWindowList[l]->Mapped=wsNone; goto expose; case FocusIn: if ( wsWindowList[l]->Focused == wsFocused ) break; - i=wsWindowFocusIn; wsWindowList[l]->Focused=wsFocused; goto expose; + i=wsWindowFocusIn; + wsWindowList[l]->OFocused=wsWindowList[l]->Focused; + wsWindowList[l]->Focused=wsFocused; + goto expose; case FocusOut: if ( wsWindowList[l]->Focused == wsNone ) break; - i=wsWindowFocusOut; wsWindowList[l]->Focused=wsNone; goto expose; + i=wsWindowFocusOut; + wsWindowList[l]->OFocused=wsWindowList[l]->Focused; + wsWindowList[l]->Focused=wsNone; + goto expose; case VisibilityNotify: switch( Event->xvisibility.state ) {
--- a/Gui/wm/ws.h Sat Sep 01 15:49:31 2001 +0000 +++ b/Gui/wm/ws.h Sat Sep 01 17:53:07 2001 +0000 @@ -124,6 +124,8 @@ int CapsLock; // --- Misc ------------------------------------------------------------------------------------- + int OFocused; + Atom AtomDeleteWindow; Atom AtomTakeFocus; Atom AtomRolle;