diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-08-25 21:04:29 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-08-25 21:04:29 +0000 |
commit | 9f6529b3d3a1ec681a84735d57a9f2d8656809af (patch) | |
tree | 4943e4a95c68932a956ce7a693c58f5b2ed79b37 /Gui/mplayer/mplayer.c | |
parent | 05f7ab93841eef7bf50c31b64bf723c100e0c123 (diff) |
GUI version n-1
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1694 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui/mplayer/mplayer.c')
-rw-r--r-- | Gui/mplayer/mplayer.c | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/Gui/mplayer/mplayer.c b/Gui/mplayer/mplayer.c new file mode 100644 index 0000000000..6e8cc979ef --- /dev/null +++ b/Gui/mplayer/mplayer.c @@ -0,0 +1,112 @@ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#include "./mplayer.h" +#include "../events.h" +#include "../app.h" +#include "../skin/skin.h" +#include "../skin/font.h" +#include "../wm/ws.h" +#include "../wm/wskeys.h" +#include "../wm/widget.h" +#include "../bitmap/bitmap.h" +#include "../timer.h" +#include "../language.h" +#include "../error.h" + +#include "../../config.h" + +#define mplMouseTimerConst 100 +#define mplRedrawTimerConst 50 + +int mplMouseTimer = mplMouseTimerConst; +int mplRedrawTimer = mplRedrawTimerConst; +int mplGeneralTimer = -1; +int mplTimer = 0; + +int mplSkinChanged = 0; + +void mplMsgHandle( int msg,float param ); + +#include "widgets.h" +#include "play.h" +#include "menu.h" +#include "mw.h" +#include "sw.h" +#include "widget.h" + +void mplTimerHandler( int signum ) +{ + mplTimer++; + mplMouseTimer--; + mplRedrawTimer--; + mplGeneralTimer--; + if ( mplMouseTimer == 0 ) mplMsgHandle( evHideMouseCursor,0 ); + if ( mplRedrawTimer == 0 ) mplMsgHandle( evRedraw,0 ); + if ( mplGeneralTimer == 0 ) mplMsgHandle( evGeneralTimer,0 ); +} + +void mplInit( int argc,char* argv[], char *envp[] ) +{ +// parse_cfgfiles( argc,argv,envp ); + gtkInit( argc,argv,envp ); + mplMPlayerInit( argc,argv,envp ); + + message=mplErrorHandler; + + wsXInit(); + + if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) + { + fprintf( stderr,langNEMDB ); + exit( 0 ); + } + + wsCreateWindow( &appMPlayer.subWindow, + appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height, + wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsShowWindow,"ViDEO" ); + + wsCreateWindow( &appMPlayer.mainWindow, + appMPlayer.main.x,appMPlayer.main.y,appMPlayer.main.width,appMPlayer.main.height, + wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsHideFrame|wsMaxSize|wsMinSize|wsShowWindow,"MPlayer" ); + + wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); + + mplMenuInit(); + + #ifdef DEBUG + dbprintf( 1,"[main] Depth on screen: %d\n",wsDepthOnScreen ); + dbprintf( 1,"[main] parent: 0x%x\n",(int)appMPlayer.mainWindow.WindowID ); + dbprintf( 1,"[main] sub: 0x%x\n",(int)appMPlayer.subWindow.WindowID ); + #endif + + appMPlayer.mainWindow.ReDraw=mplMainDraw; + appMPlayer.mainWindow.MouseHandler=mplMainMouseHandle; + appMPlayer.mainWindow.KeyHandler=mplMainKeyHandle; + + appMPlayer.subWindow.ReDraw=mplSubDraw; + appMPlayer.subWindow.MouseHandler=mplSubMouseHandle; + appMPlayer.subWindow.KeyHandler=mplMainKeyHandle; + appMPlayer.subWindow.ReSize=mplResize; + + wsPostRedisplay( &appMPlayer.mainWindow ); + wsPostRedisplay( &appMPlayer.subWindow ); + + btnModify( evSetVolume,mplShMem->Volume ); + btnModify( evSetBalance,mplShMem->Balance ); + btnModify( evSetMoviePosition,mplShMem->Position ); + + timerSetHandler( mplTimerHandler ); + timerInit(); + + wsMainLoop(); + + dbprintf( 1,"[mplayer] exit.\n" ); + + mplStop(); + timerDone(); + gtkDone(); + wsXDone(); +} |