[Mplayer-cvslog] CVS: main/Gui/mplayer menu.h,1.3,1.4 play.c,1.30,1.31 psignal.c,1.13,1.14 widgets.c,1.8,1.9 widgets.h,1.4,1.5

Zoltan Ponekker pontscho at mplayer.dev.hu
Mon Sep 17 23:16:02 CEST 2001


Update of /cvsroot/mplayer/main/Gui/mplayer
In directory mplayer:/var/tmp.root/cvs-serv18362/Gui/mplayer

Modified Files:
	menu.h play.c psignal.c widgets.c widgets.h 
Log Message:
add new features. and fix skin error loop.

Index: menu.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/menu.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- menu.h	12 Sep 2001 15:08:52 -0000	1.3
+++ menu.h	17 Sep 2001 21:16:00 -0000	1.4
@@ -123,7 +123,7 @@
    #ifdef DEBUG
     dbprintf( 1,MSGTR_NEMFMR );
    #endif
-   gtkMessageBox( MSGTR_NEMFMR );
+   gtkMessageBox( GTK_MB_FATAL,MSGTR_NEMFMR );
    return;
   }
 

Index: play.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/play.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- play.c	12 Sep 2001 22:12:05 -0000	1.30
+++ play.c	17 Sep 2001 21:16:00 -0000	1.31
@@ -127,78 +127,73 @@
 
 void ChangeSkin( void )
 {
- if ( strcmp( skinName,gtkShMem->sb.name ) )
-  {
-   int ret;
+ int ret;
+ if ( !strcmp( skinName,gtkShMem->sb.name ) ) return;
 #ifdef DEBUG
-   dbprintf( 1,"[psignal] skin: %s\n",gtkShMem->sb.name );
+ dbprintf( 1,"[psignal] skin: %s\n",gtkShMem->sb.name );
 #endif
 
-   mainVisible=0;
-
-   appInitStruct( &tmpList );
-   skinAppMPlayer=&tmpList;
-   ret=skinRead( gtkShMem->sb.name );
+ mainVisible=0;
 
-   fntFreeFont();
-
-   appInitStruct( &tmpList );
-   skinAppMPlayer=&appMPlayer;
-   appInitStruct( &appMPlayer );
-   if ( !ret ) strcpy( skinName,gtkShMem->sb.name );
-   skinRead( skinName );
+ appInitStruct( &tmpList );
+ skinAppMPlayer=&tmpList;
+ fntFreeFont();
+ ret=skinRead( gtkShMem->sb.name );
+
+ appInitStruct( &tmpList );
+ skinAppMPlayer=&appMPlayer;
+ appInitStruct( &appMPlayer );
+ if ( !ret ) strcpy( skinName,gtkShMem->sb.name );
+ skinRead( skinName );
+ if ( ret )
+  {
+   mainVisible=1;
+   return;
+  }
 
-   if ( ret )
-    {
-     mainVisible=1;
-     return;
-    }
+ if ( appMPlayer.menuBase.Bitmap.Image )
+  {
+   if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer );
+   if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL )
+    { message( False,MSGTR_NEMDB ); return; }
+   wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
+   wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
+  }
 
-   if ( appMPlayer.menuBase.Bitmap.Image )
-    {
-     if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer );
-     if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL )
-      { message( False,MSGTR_NEMDB ); return; }
-     wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
-     wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
-    }
-
-   mplSkinChanged=1;
-   if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height );
-   if ( !mplShMem->Playing )
+ mplSkinChanged=1;
+ if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height );
+ if ( !mplShMem->Playing )
+  {
+   mplSkinChanged=0;
+   if ( !appMPlayer.subWindow.isFullScreen ) 
     {
-     mplSkinChanged=0;
-     if ( !appMPlayer.subWindow.isFullScreen ) 
-      {
-       wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
-       wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y );
-      } 
-     wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
-     wsClearWindow( appMPlayer.subWindow );
-     mplSubRender=1; wsPostRedisplay( &appMPlayer.subWindow );
-    }
+     wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
+     wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y );
+    } 
+   wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
+   wsClearWindow( appMPlayer.subWindow );
+   mplSubRender=1; wsPostRedisplay( &appMPlayer.subWindow );
+  }
 
-   if ( mplDrawBuffer ) free( mplDrawBuffer );
-   if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
-    { message( False,MSGTR_NEMDB ); return; }
-   wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow );
-   wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
-   wsMoveWindow( &appMPlayer.mainWindow,appMPlayer.main.x,appMPlayer.main.y );
-   wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
-   wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
-   mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
-   wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration );
-   wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
+ if ( mplDrawBuffer ) free( mplDrawBuffer );
+ if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
+  { message( False,MSGTR_NEMDB ); return; }
+ wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow );
+ wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
+ wsMoveWindow( &appMPlayer.mainWindow,appMPlayer.main.x,appMPlayer.main.y );
+ wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
+ wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
+ mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
+ wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration );
+ wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
    
-   btnModify( evSetVolume,mplShMem->Volume );
-   btnModify( evSetBalance,mplShMem->Balance );
-   btnModify( evSetMoviePosition,mplShMem->Position );
-  }
- mplShMem->SkinChange=0; 
+ btnModify( evSetVolume,mplShMem->Volume );
+ btnModify( evSetBalance,mplShMem->Balance );
+ btnModify( evSetMoviePosition,mplShMem->Position );
 }
 
 void EventHandling( void )
 {
  wsHandleEvents();mplTimerHandler(0); // handle GUI timer events
- if ( mplShMem->SkinChange ) ChangeSkin();
+ if ( mplShMem->SkinChange ) { ChangeSkin(); mplShMem->SkinChange=0;  }
 }

Index: psignal.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/psignal.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- psignal.c	13 Sep 2001 19:50:06 -0000	1.13
+++ psignal.c	17 Sep 2001 21:16:00 -0000	1.14
@@ -16,7 +16,6 @@
 
 #include "../../config.h"
 #include "../../libvo/x11_common.h"
-//#include "../../libvo/sub.h"
 
 #include "./mplayer.h"
 
@@ -41,7 +40,7 @@
  n=vsnprintf( p,512,format,ap );
  va_end( ap );
  mplCriticalError=critical;
- gtkMessageBox( p );
+ gtkMessageBox( GTK_MB_ERROR,p );
 }
 
 void gtkSigHandler( int s )
@@ -63,8 +62,7 @@
    case evSkinBrowser:
         if ( gtkVisibleSkinBrowser ) gtk_widget_hide( SkinBrowser );
         gtkClearList( SkinList );
-        if ( !gtkFillSkinList( sbMPlayerPrefixDir ) ) break;
-        if ( gtkFillSkinList( sbMPlayerDirInHome ) )
+        if ( gtkFillSkinList( sbMPlayerPrefixDir )&&gtkFillSkinList( sbMPlayerDirInHome ) )
          {
           gtkSetDefaultToCList( SkinList,skinName );
           gtk_widget_show( SkinBrowser );
@@ -97,8 +95,6 @@
         break;
    case evMessageBox:
         gtk_label_set_text( gtkMessageBoxText,(char *)gtkShMem->mb.str );
-        gtk_widget_set_usize( MessageBox,gtkShMem->mb.sx,gtkShMem->mb.sy );
-        gtk_widget_set_usize( gtkMessageBoxText,gtkShMem->mb.tsx,gtkShMem->mb.tsy );
         if ( gtkVisibleMessageBox ) gtk_widget_hide( MessageBox );
         gtk_widget_show( MessageBox );
         gtkVisibleMessageBox=1;

Index: widgets.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/widgets.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- widgets.c	12 Sep 2001 15:08:52 -0000	1.8
+++ widgets.c	17 Sep 2001 21:16:00 -0000	1.9
@@ -27,6 +27,9 @@
 #include "pixmaps/file.xpm"
 #include "pixmaps/logo.xpm"
 #include "pixmaps/about.xpm"
+#include "pixmaps/stop.xpm"
+#include "pixmaps/error.xpm"
+#include "pixmaps/warning.xpm"
 
 GtkWidget     * SkinBrowser;
 GtkWidget     * PlayList;
@@ -57,7 +60,7 @@
  SkinBrowser=create_SkinBrowser();
  PlayList=create_PlayList();
  FileSelect=create_FileSelect();
- MessageBox=create_MessageBox();
+ MessageBox=create_MessageBox(0);
  Options=create_Options();
 }
 
@@ -103,17 +106,9 @@
  kill( gtkPID,SIGKILL );
 }
 
-void gtkMessageBox( gchar * str )
+void gtkMessageBox( int type,gchar * str )
 {
- gtkShMem->mb.sx=420; gtkShMem->mb.sy=128;
- gtkShMem->mb.tsx=384; gtkShMem->mb.tsy=77;
- if ( strlen( str ) > 200 )
-  {
-   gtkShMem->mb.sx=512;
-   gtkShMem->mb.sy=128;
-   gtkShMem->mb.tsx=476;
-   gtkShMem->mb.tsy=77;
-  }
+ gtkShMem->mb.type=type;
  strcpy( gtkShMem->mb.str,str );
  gtkSendMessage( evMessageBox );
 }

Index: widgets.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/widgets.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- widgets.h	1 Sep 2001 18:39:46 -0000	1.4
+++ widgets.h	17 Sep 2001 21:16:00 -0000	1.5
@@ -7,6 +7,12 @@
 
 #include "../../linux/shmem.h"
 
+#define GTK_MB_SIMPLE 0
+#define GTK_MB_MODAL 1
+#define GTK_MB_FATAL 2
+#define GTK_MB_ERROR 4
+#define GTK_MB_WARNING 8
+
 typedef struct
 {
  char dir[ 1024 ];
@@ -19,6 +25,7 @@
  int  sy;
  int  tsx;
  int  tsy;
+ int  type;
  char str[512];
 } gtkMessageBoxStruct;
 
@@ -73,7 +80,7 @@
 
 extern void gtkInit( int argc,char* argv[], char *envp[] );
 extern void gtkDone( void );
-extern void gtkMessageBox( gchar * str );
+extern void gtkMessageBox( int type,gchar * str );
 extern int  gtkFillSkinList( gchar * dir );
 extern void gtkClearList( GtkWidget * list );
 extern void gtkSetDefaultToCList( GtkWidget * list,char * item );




More information about the MPlayer-cvslog mailing list