diff options
author | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-23 15:12:55 +0000 |
---|---|---|
committer | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-23 15:12:55 +0000 |
commit | c090d0da98cfc613b7b9b7227dd505735df224a6 (patch) | |
tree | 0e27f5b57f9efcde040f3b8381544468612f47d6 | |
parent | 469f2d1b7e6c2251cbc9418b111f5bc700c7a262 (diff) | |
download | mpv-c090d0da98cfc613b7b9b7227dd505735df224a6.tar.bz2 mpv-c090d0da98cfc613b7b9b7227dd505735df224a6.tar.xz |
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4819 b3059339-0415-0410-9bf9-f77b7e298cf2
45 files changed, 735 insertions, 1418 deletions
@@ -8,7 +8,6 @@ #include "../help_mp.h" #include "app.h" -#include "error.h" #include "wm/wskeys.h" #include "skin/skin.h" #include "mplayer/mplayer.h" @@ -106,10 +105,9 @@ void appInit( int argc,char* argv[], char *envp[], void* disp ) printf("SKIN dir 2: '%s'\n",skinMPlayerDir); if ( !skinName ) { - if ( ( skinName=(char *)calloc( 1,7 ) ) == NULL ) { dbprintf( 0,"[config] Not enough memory.\n" ); exit( 1 ); } + if ( ( skinName=(char *)calloc( 1,7 ) ) == NULL ) { mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[config] Not enough memory.\n" ); exit( 1 ); } strcpy( skinName,"default" ); } - initDebug(NULL); // write messages to stderr switch ( skinRead( skinName ) ) { case -1: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinNotFound,skinName ); exit( 0 ); diff --git a/Gui/bitmap.c b/Gui/bitmap.c index 657c1f3330..b04e2ba926 100644 --- a/Gui/bitmap.c +++ b/Gui/bitmap.c @@ -4,7 +4,6 @@ #include <string.h> #include "bitmap.h" -#include "../error.h" #define BMP 1 #define TGA 2 @@ -25,13 +24,11 @@ int conv24to32( txSample * bf ) bf->BPP=32; if ( ( bf->Image=malloc( bf->ImageSize ) ) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[bitmap] Not enough memory for image.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] Not enough memory for image.\n" ); return 1; } memset( bf->Image,0,bf->ImageSize ); - for ( c=0,i=0;i < bf->Width * bf->Height * 3; ) + for ( c=0,i=0;i < (int)(bf->Width * bf->Height * 3); ) { bf->Image[c++]=tmpImage[i++]; bf->Image[c++]=tmpImage[i++]; @@ -47,7 +44,7 @@ void bgr2rgb( txSample * bf ) unsigned char c; int i; - for ( i=0;i < bf->ImageSize;i+=4 ) + for ( i=0;i < (int)bf->ImageSize;i+=4 ) { c=bf->Image[i]; bf->Image[i]=bf->Image[i+2]; @@ -58,8 +55,7 @@ void bgr2rgb( txSample * bf ) void Normalize( txSample * bf ) { int i; - - for ( i=0;i < bf->ImageSize;i+=4 ) bf->Image[i+3]=0; + for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i+3]=0; } unsigned char tmp[512]; @@ -149,23 +145,17 @@ int bpRead( char * fname, txSample * bf ) bgr=1; break; case TGAPACKED: - #ifdef DEBUG - dbprintf( 4,"[bitmap] sorry, packed TGA not supported.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, packed TGA not supported.\n" ); return -6; default: { - #ifdef DEBUG - dbprintf( 4,"[bitmap] Unknown file type ( %s ).\n",fname ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] Unknown file type ( %s ).\n",fname ); return -7; } } if ( bf->BPP < 24 ) { - #ifdef DEBUG - dbprintf( 4,"[bitmap] sorry, 16 or less bitmaps not supported.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, 16 or less bitmaps not supported.\n" ); return -1; } if ( conv24to32( bf ) ) return -8; @@ -180,15 +170,15 @@ void Convert32to1( txSample * in,txSample * out,int adaptivlimit ) out->Height=in->Height; out->BPP=1; out->ImageSize=out->Width * out->Height / 8; - dbprintf( 4,"[c1to32] imagesize: %d\n",out->ImageSize ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c1to32] imagesize: %d\n",out->ImageSize ); out->Image=(char *)calloc( 1,out->ImageSize ); - if ( out->Image == NULL ) dbprintf( 4,"nem van ram baze\n" ); + if ( out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" ); { int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0; int nothaveshape = 1; buf=(unsigned long *)in->Image; - for ( b=0,i=0;i < out->Width * out->Height;i++ ) + for ( b=0,i=0;i < (int)(out->Width * out->Height);i++ ) { - if ( buf[i] != adaptivlimit ) tmp=( tmp >> 1 )|128; + if ( (int)buf[i] != adaptivlimit ) tmp=( tmp >> 1 )|128; else { tmp=tmp >> 1; buf[i]=nothaveshape=0; } if ( b++ == 7 ) { out->Image[c++]=tmp; tmp=b=0; } } @@ -205,12 +195,12 @@ void Convert1to32( txSample * in,txSample * out ) out->BPP=32; out->ImageSize=out->Width * out->Height * 4; out->Image=(char *)calloc( 1,out->ImageSize ); - dbprintf( 4,"[c32to1] imagesize: %d\n",out->ImageSize ); - if ( out->Image == NULL ) dbprintf( 4,"nem van ram baze\n" ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c32to1] imagesize: %d\n",out->ImageSize ); + if ( (int)out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" ); { int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0; buf=(unsigned long *)out->Image; - for ( c=0,i=0;i < in->Width * in->Height / 8;i++ ) + for ( c=0,i=0;i < (int)(in->Width * in->Height / 8);i++ ) { tmp=in->Image[i]; for ( b=0;b<8;b++ ) diff --git a/Gui/bitmap.h b/Gui/bitmap.h index 6daa2927a1..913f2636a2 100644 --- a/Gui/bitmap.h +++ b/Gui/bitmap.h @@ -14,6 +14,7 @@ typedef struct _txSample #include "tga/tga.h" #include "bmp/bmp.h" #include "png/png.h" +#include "../../mp_msg.h" extern int bpRead( char * fname, txSample * bf ); extern int conv24to32( txSample * bf ); diff --git a/Gui/bitmap/bitmap.c b/Gui/bitmap/bitmap.c index 657c1f3330..b04e2ba926 100644 --- a/Gui/bitmap/bitmap.c +++ b/Gui/bitmap/bitmap.c @@ -4,7 +4,6 @@ #include <string.h> #include "bitmap.h" -#include "../error.h" #define BMP 1 #define TGA 2 @@ -25,13 +24,11 @@ int conv24to32( txSample * bf ) bf->BPP=32; if ( ( bf->Image=malloc( bf->ImageSize ) ) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[bitmap] Not enough memory for image.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] Not enough memory for image.\n" ); return 1; } memset( bf->Image,0,bf->ImageSize ); - for ( c=0,i=0;i < bf->Width * bf->Height * 3; ) + for ( c=0,i=0;i < (int)(bf->Width * bf->Height * 3); ) { bf->Image[c++]=tmpImage[i++]; bf->Image[c++]=tmpImage[i++]; @@ -47,7 +44,7 @@ void bgr2rgb( txSample * bf ) unsigned char c; int i; - for ( i=0;i < bf->ImageSize;i+=4 ) + for ( i=0;i < (int)bf->ImageSize;i+=4 ) { c=bf->Image[i]; bf->Image[i]=bf->Image[i+2]; @@ -58,8 +55,7 @@ void bgr2rgb( txSample * bf ) void Normalize( txSample * bf ) { int i; - - for ( i=0;i < bf->ImageSize;i+=4 ) bf->Image[i+3]=0; + for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i+3]=0; } unsigned char tmp[512]; @@ -149,23 +145,17 @@ int bpRead( char * fname, txSample * bf ) bgr=1; break; case TGAPACKED: - #ifdef DEBUG - dbprintf( 4,"[bitmap] sorry, packed TGA not supported.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, packed TGA not supported.\n" ); return -6; default: { - #ifdef DEBUG - dbprintf( 4,"[bitmap] Unknown file type ( %s ).\n",fname ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] Unknown file type ( %s ).\n",fname ); return -7; } } if ( bf->BPP < 24 ) { - #ifdef DEBUG - dbprintf( 4,"[bitmap] sorry, 16 or less bitmaps not supported.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, 16 or less bitmaps not supported.\n" ); return -1; } if ( conv24to32( bf ) ) return -8; @@ -180,15 +170,15 @@ void Convert32to1( txSample * in,txSample * out,int adaptivlimit ) out->Height=in->Height; out->BPP=1; out->ImageSize=out->Width * out->Height / 8; - dbprintf( 4,"[c1to32] imagesize: %d\n",out->ImageSize ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c1to32] imagesize: %d\n",out->ImageSize ); out->Image=(char *)calloc( 1,out->ImageSize ); - if ( out->Image == NULL ) dbprintf( 4,"nem van ram baze\n" ); + if ( out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" ); { int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0; int nothaveshape = 1; buf=(unsigned long *)in->Image; - for ( b=0,i=0;i < out->Width * out->Height;i++ ) + for ( b=0,i=0;i < (int)(out->Width * out->Height);i++ ) { - if ( buf[i] != adaptivlimit ) tmp=( tmp >> 1 )|128; + if ( (int)buf[i] != adaptivlimit ) tmp=( tmp >> 1 )|128; else { tmp=tmp >> 1; buf[i]=nothaveshape=0; } if ( b++ == 7 ) { out->Image[c++]=tmp; tmp=b=0; } } @@ -205,12 +195,12 @@ void Convert1to32( txSample * in,txSample * out ) out->BPP=32; out->ImageSize=out->Width * out->Height * 4; out->Image=(char *)calloc( 1,out->ImageSize ); - dbprintf( 4,"[c32to1] imagesize: %d\n",out->ImageSize ); - if ( out->Image == NULL ) dbprintf( 4,"nem van ram baze\n" ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c32to1] imagesize: %d\n",out->ImageSize ); + if ( (int)out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" ); { int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0; buf=(unsigned long *)out->Image; - for ( c=0,i=0;i < in->Width * in->Height / 8;i++ ) + for ( c=0,i=0;i < (int)(in->Width * in->Height / 8);i++ ) { tmp=in->Image[i]; for ( b=0;b<8;b++ ) diff --git a/Gui/bitmap/bitmap.h b/Gui/bitmap/bitmap.h index 6daa2927a1..913f2636a2 100644 --- a/Gui/bitmap/bitmap.h +++ b/Gui/bitmap/bitmap.h @@ -14,6 +14,7 @@ typedef struct _txSample #include "tga/tga.h" #include "bmp/bmp.h" #include "png/png.h" +#include "../../mp_msg.h" extern int bpRead( char * fname, txSample * bf ); extern int conv24to32( txSample * bf ); diff --git a/Gui/bitmap/bmp/bmp.c b/Gui/bitmap/bmp/bmp.c index b362d3f9a3..4511f33eef 100644 --- a/Gui/bitmap/bmp/bmp.c +++ b/Gui/bitmap/bmp/bmp.c @@ -27,7 +27,6 @@ #include "bmp.h" #include "../bitmap.h" -#include "../../error.h" int bmpRead( unsigned char * fname,txSample * bF ) { @@ -40,16 +39,12 @@ int bmpRead( unsigned char * fname,txSample * bF ) if ( (BMP=fopen( fname,"rt" )) == NULL ) { -#ifdef DEBUG - dbprintf( 4,"[bmp] File not found ( %s ).\n",fname ); -#endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] File not found ( %s ).\n",fname ); return 1; } if ( (i=fread( bmpHeader,54,1,BMP )) != 1 ) { -#ifdef DEBUG - dbprintf( 4,"[bmp] Header read error ( %s ).\n",fname ); -#endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] Header read error ( %s ).\n",fname ); return 2; } // memcpy( &bF->Size,&bmpHeader[2],4 ); @@ -61,31 +56,23 @@ int bmpRead( unsigned char * fname,txSample * bF ) if ( bF->BPP < 24 ) { - #ifdef DEBUG - dbprintf( 4,"[bmp] Sorry, this loader not supported 16 bit or less ...\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] Sorry, this loader not supported 16 bit or less ...\n" ); return 3; } -#ifdef DEBUG - dbprintf( 4,"[bmp] filename: %s\n",fname ); - dbprintf( 4,"[bmp] size: %dx%d bits: %d\n",bF->Width,bF->Height,bF->BPP ); - dbprintf( 4,"[bmp] imagesize: %lu\n",bF->ImageSize ); -#endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] filename: %s\n",fname ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] size: %dx%d bits: %d\n",bF->Width,bF->Height,bF->BPP ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] imagesize: %lu\n",bF->ImageSize ); if ( ( bF->Image=malloc( bF->ImageSize ) ) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[bmp] Not enough memory for image buffer.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] Not enough memory for image buffer.\n" ); return 4; } if ( (i=fread( bF->Image,bF->ImageSize,1,BMP )) != 1 ) { - #ifdef DEBUG - dbprintf( 4,"[bmp] Image read error.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] Image read error.\n" ); return 5; } @@ -94,9 +81,7 @@ int bmpRead( unsigned char * fname,txSample * bF ) linesize=bF->Width * ( bF->BPP / 8 ); if ( (line=malloc( linesize )) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[bmp] Not enough memory for flipping.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] Not enough memory for flipping.\n" ); return 6; } diff --git a/Gui/bitmap/png/png.c b/Gui/bitmap/png/png.c index 113a22b095..175cf7e582 100644 --- a/Gui/bitmap/png/png.c +++ b/Gui/bitmap/png/png.c @@ -2,7 +2,6 @@ #include <stdlib.h> #include "./png.h" -#include "../../error.h" #include <png.h> typedef struct @@ -106,9 +105,7 @@ int pngRead( unsigned char * fname,txSample * bf ) if ( pngLoadRaw( fname,&raw ) ) { - #ifdef DEBUG - dbprintf( 4,"[png] file read error ( %s ).\n",fname ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] file read error ( %s ).\n",fname ); return 1; } bf->Width=raw.Width; @@ -117,17 +114,13 @@ int pngRead( unsigned char * fname,txSample * bf ) bf->ImageSize=bf->Width * bf->Height * ( bf->BPP / 8 ); if ( ( bf->Image=malloc( bf->ImageSize ) ) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[png] Not enough memory for image buffer.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] Not enough memory for image buffer.\n" ); return 2; } memcpy( bf->Image,raw.Data,bf->ImageSize ); free( raw.Data ); - #ifdef DEBUG - dbprintf( 4,"[png] filename: %s.\n",fname ); - dbprintf( 4,"[png] size: %dx%d bits: %d\n",bf->Width,bf->Height,bf->BPP ); - dbprintf( 4,"[png] imagesize: %lu\n",bf->ImageSize ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] filename: %s.\n",fname ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] size: %dx%d bits: %d\n",bf->Width,bf->Height,bf->BPP ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] imagesize: %lu\n",bf->ImageSize ); return 0; } diff --git a/Gui/bitmap/tga/tga.c b/Gui/bitmap/tga/tga.c index 8a33f6a07e..de826d2bd8 100644 --- a/Gui/bitmap/tga/tga.c +++ b/Gui/bitmap/tga/tga.c @@ -4,7 +4,6 @@ #include <stdlib.h> #include "tga.h" -#include "../../error.h" int tgaRead( char * filename,txSample * bf ) { @@ -20,23 +19,17 @@ int tgaRead( char * filename,txSample * bf ) if ( !strstr( tmp,".tga" ) ) strcat( tmp,".tga" ); if ( (BMP=fopen( tmp,"rb" )) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[tga] File not found ( %s ).\n",tmp ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] File not found ( %s ).\n",tmp ); return 1; } if ( (i=fread( &tgaHeader,sizeof( tgaHeader ),1,BMP )) != 1 ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Header read error ( %s ).\n",tmp ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Header read error ( %s ).\n",tmp ); return 2; } if ( tgaHeader.depth < 24 ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Sorry, this loader not supported 16 bit or less ...\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Sorry, this loader not supported 16 bit or less ...\n" ); return 3; } bf->Width=tgaHeader.sx; @@ -46,9 +39,7 @@ int tgaRead( char * filename,txSample * bf ) if ( ( bf->Image=malloc( bf->ImageSize ) ) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Not enough memory for image buffer.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Not enough memory for image buffer.\n" ); return 4; } @@ -57,35 +48,29 @@ int tgaRead( char * filename,txSample * bf ) { if ( ( comment=malloc( tgaHeader.tmp[0] + 1 ) ) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Not enough memory for comment string.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Not enough memory for comment string.\n" ); return 5; } memset( comment,0,tgaHeader.tmp[0] + 1 ); if ( fread( comment,tgaHeader.tmp[0],1,BMP ) != 1 ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Comment read error.\n" ); - #endif - return 6; + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Comment read error.\n" ); + return 6; } } - #ifdef DEBUG - dbprintf( 4,"[tga] filename ( read ): %s\n",tmp ); - dbprintf( 4,"[tga] size: %dx%d bits: %d\n",bf->Width,bf->Height,bf->BPP ); - dbprintf( 4,"[tga] imagesize: %lu\n",bf->ImageSize ); - if ( comment ) dbprintf( 4,"[tga] comment: %s\n",comment ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] filename ( read ): %s\n",tmp ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] size: %dx%d bits: %d\n",bf->Width,bf->Height,bf->BPP ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] imagesize: %lu\n",bf->ImageSize ); + #ifdef MP_DEBUG + if ( comment ) mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] comment: %s\n",comment ); #endif if ( comment ) free( comment ); if ( fread( bf->Image,bf->ImageSize,1,BMP ) != 1 ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Image read error.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Image read error.\n" ); return 7; } @@ -96,9 +81,7 @@ int tgaRead( char * filename,txSample * bf ) linesize=bf->Width * ( bf->BPP / 8 ); if ( (line=malloc( linesize )) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Not enough memory for flipping.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Not enough memory for flipping.\n" ); return 8; } @@ -129,7 +112,7 @@ void tgaWriteTexture( char * filename,txSample * bf ) if ( !strstr( tmp,".tga" ) ) strcat( tmp,".tga" ); if ( ( BMP=fopen( tmp,"wb+" ) ) == NULL ) { - dbprintf( 0,"[tga] File not open ( %s ).\n",tmp ); + mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[tga] File not open ( %s ).\n",tmp ); exit( 0 ); } memset( &tgaHeader,0,sizeof( tgaHeader ) ); @@ -141,21 +124,19 @@ void tgaWriteTexture( char * filename,txSample * bf ) if ( bf->BPP != 8 ) tgaHeader.tmp[2]=2; else tgaHeader.tmp[2]=3; - #ifdef DEBUG - dbprintf( 4,"\n[tga] filename ( write ): %s\n",tmp ); - dbprintf( 4,"[tga] size: %dx%d\n",bf->Width,bf->Height ); - dbprintf( 4,"[tga] bits: %d\n",bf->BPP ); - dbprintf( 4,"[tga] imagesize: %lu\n",bf->ImageSize ); - dbprintf( 4,"[tga] comment: %s\n",comment ); - dbprintf( 4,"\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[tga] filename ( write ): %s\n",tmp ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] size: %dx%d\n",bf->Width,bf->Height ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] bits: %d\n",bf->BPP ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] imagesize: %lu\n",bf->ImageSize ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] comment: %s\n",comment ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n" ); if ( tgaHeader.ctmp == 0 ) { linesize=bf->Width * ( bf->BPP / 8 ); if ( (line=malloc( linesize )) == NULL ) { - dbprintf( 0,"[tga] Not enough memory for flipping.\n" ); + mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[tga] Not enough memory for flipping.\n" ); exit( 0 ); } diff --git a/Gui/error.c b/Gui/error.c deleted file mode 100644 index 16a38b1c24..0000000000 --- a/Gui/error.c +++ /dev/null @@ -1,61 +0,0 @@ - -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> - -#include "error.h" - -int debug_level = 2; -FILE * debug_file; -int debug_stderr = 0; - -void defaultErrorHandler( int critical,const char * format, ... ) -{ - char * p; - va_list ap; - - if ( (p=(char *)malloc( 512 ) ) == NULL ) return; - va_start( ap,format ); - vsnprintf( p,512,format,ap ); - va_end( ap ); - fprintf( stderr,"%s",p ); - free( p ); - if ( critical ) exit( 1 ); -} - -void defaultDebugHandler( int critical,const char * format, ... ) -{ - char * p; - va_list ap; - - if ( critical >= debug_level ) return; - if ( (p=(char *)malloc( 512 ) ) == NULL ) return; - va_start( ap,format ); - vsnprintf( p,512,format,ap ); - va_end( ap ); - fprintf( debug_file,"%s",p ); - free( p ); -} - -errorTHandler message = defaultErrorHandler; -errorTHandler dbprintf = defaultDebugHandler; - -void initDebug( char * name ) -{ - if ( name ) - { - if ( ( debug_file=fopen( name,"wt+" ) ) != NULL ) - { - debug_stderr=0; - return; - } - } - debug_file=stderr; - debug_stderr=1; -} -void doneDebug( void ) -{ - if ( !debug_stderr ) fclose( debug_file ); - debug_file=stderr; - debug_stderr=1; -} diff --git a/Gui/error.h b/Gui/error.h deleted file mode 100644 index 7ce79e7cde..0000000000 --- a/Gui/error.h +++ /dev/null @@ -1,22 +0,0 @@ - -#ifndef _MPLAYER_ERROR_HANDLER -#define _MPLAYER_ERROR_HANDLER - -#define True 1 -#define False 0 - -// 0 - standard message -// 1 - detto -// 2 - events -// 3 - skin reader messages -// 4 - bitmap reader messages -// 5 - signal handling messages -// 6 - gtk messages - -typedef void (*errorTHandler)( int critical,const char * format, ... ); - -extern errorTHandler message; -extern errorTHandler dbprintf; - -#endif - diff --git a/Gui/events.h b/Gui/events.h index 508e12ecb7..4c21cdbb99 100644 --- a/Gui/events.h +++ b/Gui/events.h @@ -47,7 +47,7 @@ #define evHelp 37 #define evLoadSubtitle 38 -#define evPlayDVD 39 +#define evPlayDVD 39 #define evExit 1000 diff --git a/Gui/gui.mak b/Gui/gui.mak index 5e2e05bb6e..cd12beebdd 100644 --- a/Gui/gui.mak +++ b/Gui/gui.mak @@ -7,9 +7,9 @@ GTKSRCS = $(MPLAYERDIR)gtk/menu.c $(MPLAYERDIR)gtk/mb.c $(MPLAYERDIR)gtk/about.c $(MPLAYERDIR)gtk/opts.c MPLAYERSRCS = $(MPLAYERDIR)mplayer.c $(MPLAYERDIR)widgets.c $(MPLAYERDIR)play.c \ - $(MPLAYERDIR)psignal.c $(GTKSRCS) + $(GTKSRCS) MPLAYEROBJS = $(MPLAYERSRCS:.c=.o) -SRCS = $(SKINSRC) $(BITMAPSRCS) wm/ws.c wm/wsconv.c app.c events.c timer.c error.c interface.c +SRCS = $(SKINSRC) $(BITMAPSRCS) wm/ws.c wm/wsconv.c app.c events.c interface.c OBJS = $(SRCS:.c=.o) diff --git a/Gui/interface.c b/Gui/interface.c index c4b1fba858..ff003d4064 100644 --- a/Gui/interface.c +++ b/Gui/interface.c @@ -1,9 +1,31 @@ +#include <string.h> #include "ws.h" #include "mplayer/play.h" #include "interface.h" + #include "../mplayer.h" +#include "mplayer/widgets.h" +#include "mplayer/mplayer.h" +#include "app.h" +#include "../libvo/x11_common.h" + +guiInterface_t guiIntfStruct; + +void guiInit( int argc,char* argv[], char *envp[] ) +{ + memset( &guiIntfStruct,0,sizeof( guiIntfStruct ) ); + appInit( argc,argv,envp,(void*)mDisplay ); +} + +void guiDone( void ) +{ + mp_msg( MSGT_GPLAYER,MSGL_V,"[mplayer] exit.\n" ); + mplStop(); + gtkDone(); + wsXDone(); +} void guiGetEvent( int type,char * arg ) { @@ - |