changeset 8043:e5dda05f9aab

cleanup
author pontscho
date Sat, 02 Nov 2002 16:09:05 +0000
parents 72b8f3c62d83
children 9a9b48c469f6
files Gui/Makefile Gui/app.c Gui/app.h Gui/cfg.c Gui/cfg.h Gui/events.c Gui/events.h Gui/interface.c Gui/interface.h Gui/mplayer/gtk/about.c Gui/mplayer/gtk/eq.c Gui/mplayer/gtk/fs.c Gui/mplayer/gtk/mb.c Gui/mplayer/gtk/menu.c Gui/mplayer/gtk/opts.c Gui/mplayer/gtk/pl.c Gui/mplayer/gtk/sb.c Gui/mplayer/gtk/url.c Gui/mplayer/mplayer.c Gui/mplayer/mw.h Gui/mplayer/widgets.c Gui/mplayer/widgets.h
diffstat 22 files changed, 265 insertions(+), 302 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/Makefile	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/Makefile	Sat Nov 02 16:09:05 2002 +0000
@@ -14,7 +14,7 @@
 
 CFLAGS = $(OPTIMIZE) $(INCDIR) $(DEBUG) 
 
-SRCS = wm/ws.c wm/wsxdnd.c app.c events.c interface.c cfg.c \
+SRCS = wm/ws.c wm/wsxdnd.c app.c interface.c cfg.c \
 	bitmap/bitmap.c bitmap/png/png.c \
 	skin/skin.c skin/font.c skin/cut.c \
 	mplayer/mplayer.c mplayer/widgets.c mplayer/play.c \
--- a/Gui/app.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/app.c	Sat Nov 02 16:09:05 2002 +0000
@@ -1,3 +1,4 @@
+
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -13,6 +14,61 @@
 #include "mplayer/mplayer.h"
 #include "interface.h"
 
+evName evNames[] =
+ {
+  { evNone,              "evNone"              },
+  { evPlay,              "evPlay"              },
+  { evStop,              "evStop"              },
+  { evPause,             "evPause"             },
+  { evPrev,              "evPrev"              },
+  { evNext,              "evNext"              },
+  { evLoad,              "evLoad"              },
+  { evEqualizer,         "evEqualizer"         },
+  { evEqualizer,         "evEqualeaser"        },
+  { evPlayList,          "evPlaylist"          },
+  { evExit,              "evExit"              },
+  { evIconify,           "evIconify"           },
+  { evIncBalance,        "evIncBalance"        },
+  { evDecBalance,        "evDecBalance"        },
+  { evFullScreen,        "evFullScreen"        },
+  { evFName,             "evFName"             },
+  { evMovieTime,         "evMovieTime"         },
+  { evAbout,             "evAbout"             },
+  { evLoadPlay,          "evLoadPlay"          },
+  { evPreferences,       "evPreferences"       },
+  { evSkinBrowser,       "evSkinBrowser"       },
+  { evBackward10sec,     "evBackward10sec"     },
+  { evForward10sec,      "evForward10sec"      },
+  { evBackward1min,      "evBackward1min"      },
+  { evForward1min,       "evForward1min"       },
+  { evBackward10min,     "evBackward10min"     },
+  { evForward10min,      "evForward10min"      },
+  { evIncVolume,         "evIncVolume"         },
+  { evDecVolume,         "evDecVolume"         },
+  { evMute,              "evMute"              },
+  { evIncAudioBufDelay,  "evIncAudioBufDelay"  },
+  { evDecAudioBufDelay,  "evDecAudioBufDelay"  },
+  { evPlaySwitchToPause, "evPlaySwitchToPause" },
+  { evPauseSwitchToPlay, "evPauseSwitchToPlay" },
+  { evNormalSize,        "evNormalSize"        },
+  { evDoubleSize,        "evDoubleSize"        },
+  { evSetMoviePosition,  "evSetMoviePosition"  },
+  { evSetVolume,         "evSetVolume"         },
+  { evSetBalance,        "evSetBalance"        },
+  { evHelp,		 "evHelp"	       },	
+  { evLoadSubtitle,      "evLoadSubtitle"      },
+  { evPlayDVD,		 "evPlayDVD"	       },
+  { evPlayVCD,		 "evPlayVCD"	       },
+  { evSetURL,		 "evSetURL"	       },
+  { evLoadAudioFile,	 "evLoadAudioFile"     },
+  { evDropSubtitle,      "evDropSubtitle"      },
+  { evSetAspect,	 "evSetAspect"	       }
+ };
+
+int evBoxs = sizeof( evNames ) / sizeof( evName );
+
+// ---
+
 extern char *get_path(char *);
 
 listItems   appMPlayer;
@@ -98,18 +154,3 @@
   if ( !strcmp( evNames[i].name,str ) ) return evNames[i].msg;
  return -1;
 }
-
-void appInit( void * disp )
-{
- skinDirInHome=get_path("Skin");
- skinMPlayerDir=DATADIR "/Skin";
- printf("SKIN dir 1: '%s'\n",skinDirInHome);
- printf("SKIN dir 2: '%s'\n",skinMPlayerDir);
- if ( !skinName ) skinName=strdup( "default" );
- switch ( skinRead( skinName ) )
-  {
-   case -1: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinNotFound,skinName ); exit( 0 );
-   case -2: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinCfgReadError,skinName ); exit( 0 );
-  }
- mplInit( disp ); // does gtk & ws initialization, create windows
-}
--- a/Gui/app.h	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/app.h	Sat Nov 02 16:09:05 2002 +0000
@@ -1,11 +1,100 @@
 
-#ifndef __MY_APPS
-#define __MY_APPS
+#ifndef __APPS_H
+#define __APPS_H
 
 #include "bitmap/bitmap.h"
 #include "wm/ws.h"
 #include "wm/wskeys.h"
-#include "events.h"
+
+// --- User events ------
+
+#define evNone              0
+#define evPlay              1
+#define evStop              2
+#define evPause             3
+#define evPrev              6
+#define evNext              7
+#define evLoad              8
+#define evEqualizer         9
+#define evPlayList          10
+#define evIconify           11
+#define evAbout             12
+#define evLoadPlay          13
+#define evPreferences       14
+#define evSkinBrowser       15
+#define evPlaySwitchToPause 16
+#define evPauseSwitchToPlay 17
+
+#define evBackward10sec     18
+#define evForward10sec      19
+#define evBackward1min      20
+#define evForward1min       21
+#define evBackward10min     22
+#define evForward10min      23
+
+#define evNormalSize        24
+#define evDoubleSize        25
+#define evFullScreen        26
+
+#define evSetMoviePosition  27
+#define evSetVolume         28
+#define evSetBalance        29
+#define evMute              30
+
+#define evIncVolume         31
+#define evDecVolume         32
+#define evIncAudioBufDelay  33
+#define evDecAudioBufDelay  34
+#define evIncBalance        35
+#define evDecBalance        36
+
+#define evHelp              37
+
+#define evLoadSubtitle      38
+#define evDropSubtitle      43
+#define evPlayDVD           39
+#define evPlayVCD	    40
+#define evPlayNetwork       41
+#define evLoadAudioFile	    42
+#define evSetAspect         44
+// 45 ...
+
+#define evExit              1000
+
+// --- General events ---
+
+#define evFileLoaded      5000
+#define evHideMouseCursor 5001
+#define evMessageBox      5002
+#define evGeneralTimer    5003
+#define evGtkIsOk         5004
+#define evShowPopUpMenu   5005
+#define evHidePopUpMenu   5006
+#define evSetDVDAudio     5007
+#define evSetDVDSubtitle  5008
+#define evSetDVDTitle     5009
+#define evSetDVDChapter   5010
+#define evSubtitleLoaded  5011
+#define evSetVCDTrack     5012
+#define evSetURL          5013
+
+#define evFName           7000
+#define evMovieTime       7001
+#define evRedraw          7002
+#define evHideWindow      7003
+#define evShowWindow      7004
+#define evFirstLoad       7005
+
+// ----------------------
+
+typedef struct
+{
+ int    msg;
+ char * name;
+} evName;
+
+extern int evBoxs;
+extern evName evNames[];
 
 #define itNULL      0
 #define itButton    101 // button
@@ -77,7 +166,6 @@
 extern char      * skinMPlayerDir;
 extern char      * skinName;
 
-extern void appInit( void * disp );
 extern void appInitStruct( listItems * item );
 extern void appClearItem( wItem * item );
 extern void appCopy( listItems * item1,listItems * item2 );
--- a/Gui/cfg.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/cfg.c	Sat Nov 02 16:09:05 2002 +0000
@@ -24,11 +24,14 @@
 int    gtkEnableAudioEqualizer = 0;
 
 int    gtkVopPP = 0;
-int    gtkVopLAVC = 0;
-int    gtkVopFAME = 0;
+#ifdef USE_LIBAVCODEC
+ int    gtkVopLAVC = 0;
+#endif
+#ifdef USE_LIBFAME
+ int    gtkVopFAME = 0;
+#endif
 
 int    gtkAONoSound = 0;
-float  gtkAODelay = 0.0f;
 int    gtkAONorm = 0;
 int    gtkAOSurround = 0;
 int    gtkAOExtraStereo = 0;
@@ -73,8 +76,12 @@
 
  { "vf_pp",&gtkVopPP,CONF_TYPE_FLAG,0,0,1,NULL },
  { "vf_autoq",&auto_quality,CONF_TYPE_INT,CONF_RANGE,0,100,NULL },
+#ifdef USE_LIBAVCODEC
  { "vf_lavc",&gtkVopLAVC,CONF_TYPE_FLAG,0,0,1,NULL },
+#endif
+#ifdef USE_LIBFAME
  { "vf_fame",&gtkVopFAME,CONF_TYPE_FLAG,0,0,1,NULL },
+#endif
 
  { "ao_driver",&audio_driver_list,CONF_TYPE_STRING_LIST,0,0,0,NULL },
  { "ao_nosound",&gtkAONoSound,CONF_TYPE_FLAG,0,0,1,NULL },
@@ -82,7 +89,6 @@
  { "ao_surround",&gtkAOSurround,CONF_TYPE_FLAG,0,0,1,NULL },
  { "ao_extra_stereo",&gtkAOExtraStereo,CONF_TYPE_FLAG,0,0,1,NULL },
  { "ao_extra_stereo_coefficient",&gtkAOExtraStereoMul,CONF_TYPE_FLOAT,CONF_RANGE,-10,10,NULL },
- { "ao_delay",&gtkAODelay,CONF_TYPE_FLOAT,CONF_RANGE,-100,100,NULL },
  { "ao_oss_mixer",&gtkAOOSSMixer,CONF_TYPE_STRING,0,0,0,NULL },
  { "ao_oss_device",&gtkAOOSSDevice,CONF_TYPE_STRING,0,0,0,NULL },
  
--- a/Gui/cfg.h	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/cfg.h	Sat Nov 02 16:09:05 2002 +0000
@@ -9,7 +9,6 @@
 extern int    gtkVopFAME;
 
 extern int    gtkAONoSound;
-extern float  gtkAODelay;
 extern int    gtkAONorm;
 extern int    gtkAOFakeSurround;
 extern int    gtkAOExtraStereo;
--- a/Gui/events.c	Sat Nov 02 16:00:21 2002 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-
-#include "events.h"
-
-evName evNames[] =
- {
-  { evNone,              "evNone"              },
-  { evPlay,              "evPlay"              },
-  { evStop,              "evStop"              },
-  { evPause,             "evPause"             },
-  { evPrev,              "evPrev"              },
-  { evNext,              "evNext"              },
-  { evLoad,              "evLoad"              },
-  { evEqualizer,         "evEqualizer"         },
-  { evEqualizer,         "evEqualeaser"        },
-  { evPlayList,          "evPlaylist"          },
-  { evExit,              "evExit"              },
-  { evIconify,           "evIconify"           },
-  { evIncBalance,        "evIncBalance"        },
-  { evDecBalance,        "evDecBalance"        },
-  { evFullScreen,        "evFullScreen"        },
-  { evFName,             "evFName"             },
-  { evMovieTime,         "evMovieTime"         },
-  { evAbout,             "evAbout"             },
-  { evLoadPlay,          "evLoadPlay"          },
-  { evPreferences,       "evPreferences"       },
-  { evSkinBrowser,       "evSkinBrowser"       },
-  { evBackward10sec,     "evBackward10sec"     },
-  { evForward10sec,      "evForward10sec"      },
-  { evBackward1min,      "evBackward1min"      },
-  { evForward1min,       "evForward1min"       },
-  { evBackward10min,     "evBackward10min"     },
-  { evForward10min,      "evForward10min"      },
-  { evIncVolume,         "evIncVolume"         },
-  { evDecVolume,         "evDecVolume"         },
-  { evMute,              "evMute"              },
-  { evIncAudioBufDelay,  "evIncAudioBufDelay"  },
-  { evDecAudioBufDelay,  "evDecAudioBufDelay"  },
-  { evPlaySwitchToPause, "evPlaySwitchToPause" },
-  { evPauseSwitchToPlay, "evPauseSwitchToPlay" },
-  { evNormalSize,        "evNormalSize"        },
-  { evDoubleSize,        "evDoubleSize"        },
-  { evSetMoviePosition,  "evSetMoviePosition"  },
-  { evSetVolume,         "evSetVolume"         },
-  { evSetBalance,        "evSetBalance"        },
-  { evHelp,		 "evHelp"	       },	
-  { evLoadSubtitle,      "evLoadSubtitle"      },
-  { evPlayDVD,		 "evPlayDVD"	       },
-  { evPlayVCD,		 "evPlayVCD"	       },
-  { evSetURL,		 "evSetURL"	       },
-  { evLoadAudioFile,	 "evLoadAudioFile"     },
-  { evDropSubtitle,      "evDropSubtitle"      },
-  { evSetAspect,	 "evSetAspect"	       }
- };
-
-int evBoxs = sizeof( evNames ) / sizeof( evName );
--- a/Gui/events.h	Sat Nov 02 16:00:21 2002 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-
-#ifndef _MYEVENTHANDLER
-#define _MYEVENTHANDLER
-
-// --- User events ------
-
-#define evNone              0
-#define evPlay              1
-#define evStop              2
-#define evPause             3
-#define evPrev              6
-#define evNext              7
-#define evLoad              8
-#define evEqualizer         9
-#define evPlayList          10
-#define evIconify           11
-#define evAbout             12
-#define evLoadPlay          13
-#define evPreferences       14
-#define evSkinBrowser       15
-#define evPlaySwitchToPause 16
-#define evPauseSwitchToPlay 17
-
-#define evBackward10sec     18
-#define evForward10sec      19
-#define evBackward1min      20
-#define evForward1min       21
-#define evBackward10min     22
-#define evForward10min      23
-
-#define evNormalSize        24
-#define evDoubleSize        25
-#define evFullScreen        26
-
-#define evSetMoviePosition  27
-#define evSetVolume         28
-#define evSetBalance        29
-#define evMute              30
-
-#define evIncVolume         31
-#define evDecVolume         32
-#define evIncAudioBufDelay  33
-#define evDecAudioBufDelay  34
-#define evIncBalance        35
-#define evDecBalance        36
-
-#define evHelp              37
-
-#define evLoadSubtitle      38
-#define evDropSubtitle      43
-#define evPlayDVD           39
-#define evPlayVCD	    40
-#define evPlayNetwork       41
-#define evLoadAudioFile	    42
-#define evSetAspect         44
-// 45 ...
-
-#define evExit              1000
-
-// --- General events ---
-
-#define evFileLoaded      5000
-#define evHideMouseCursor 5001
-#define evMessageBox      5002
-#define evGeneralTimer    5003
-#define evGtkIsOk         5004
-#define evShowPopUpMenu   5005
-#define evHidePopUpMenu   5006
-#define evSetDVDAudio     5007
-#define evSetDVDSubtitle  5008
-#define evSetDVDTitle     5009
-#define evSetDVDChapter   5010
-#define evSubtitleLoaded  5011
-#define evSetVCDTrack     5012
-#define evSetURL          5013
-
-#define evFName           7000
-#define evMovieTime       7001
-#define evRedraw          7002
-#define evHideWindow      7003
-#define evShowWindow      7004
-#define evFirstLoad       7005
-
-// ----------------------
-
-typedef struct
-{
- int    msg;
- char * name;
-} evName;
-
-extern int evBoxs;
-extern evName evNames[];
-
-#endif
--- a/Gui/interface.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/interface.c	Sat Nov 02 16:09:05 2002 +0000
@@ -163,8 +163,21 @@
  fullscreen=gtkLoadFullscreen;       
    
  gtkInit();
+// --- initialize X 
  wsXInit( (void *)mDisplay );
- appInit( (void*)mDisplay );
+// ---
+ skinDirInHome=get_path("Skin");
+ skinMPlayerDir=DATADIR "/Skin";
+ printf("SKIN dir 1: '%s'\n",skinDirInHome);
+ printf("SKIN dir 2: '%s'\n",skinMPlayerDir);
+ if ( !skinName ) skinName=strdup( "default" );
+ switch ( skinRead( skinName ) )
+  {
+   case -1: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinNotFound,skinName ); exit( 0 );
+   case -2: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinCfgReadError,skinName ); exit( 0 );
+  }
+ mplInit( (void *)mDisplay );
+// ---
 
  if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE );
  if ( sub_name ) guiSetFilename( guiIntfStruct.Subtitlename,sub_name );
@@ -175,9 +188,8 @@
 
 void guiDone( void )
 {
- mp_msg( MSGT_GPLAYER,MSGL_V,"[mplayer] exit.\n" );
+ mp_msg( MSGT_GPLAYER,MSGL_V,"[gui] done.\n" );
  cfg_write();
- gtkDone();
  wsXDone();
 }
 
@@ -399,7 +411,7 @@
 		  if ( vcd_seek_to_track( stream->fd,i ) < 0 ) break;
 		vcd_seek_to_track( stream->fd,vcd_track );
 		guiIntfStruct.VCDTracks=--i;
-		mp_msg( MSGT_GPLAYER,MSGL_INFO,"[interface] vcd tracks: %d\n",guiIntfStruct.VCDTracks );
+		mp_msg( MSGT_GPLAYER,MSGL_INFO,"[gui] vcd tracks: %d\n",guiIntfStruct.VCDTracks );
 		guiIntfStruct.Track=vcd_track;
 	        break;
 	       }
@@ -478,7 +490,14 @@
 	 }
 // -- subtitle
 #ifdef HAVE_DXR3
-	if ( video_driver_list && !gstrcmp( video_driver_list[0],"dxr3" ) && guiIntfStruct.FileFormat != DEMUXER_TYPE_MPEG_PS && !gtkVopLAVC && !gtkVopFAME )
+	if ( video_driver_list && !gstrcmp( video_driver_list[0],"dxr3" ) && guiIntfStruct.FileFormat != DEMUXER_TYPE_MPEG_PS
+#ifdef USE_LIBAVCODEC
+	 && !gtkVopLAVC
+#endif
+#ifdef USE_LIBFAME
+	 && !gtkVopFAME 
+#endif
+	 )
 	 {
 	  gtkMessageBox( GTK_MB_FATAL,MSGTR_NEEDLAVCFAME );
 	  guiIntfStruct.Playing=0;
@@ -524,14 +543,22 @@
 	}
 
 #ifdef HAVE_DXR3
+#ifdef USE_LIBAVCODEC
 	remove_vop( "lavc" );
+#endif
+#ifdef USE_LIBFAME
 	remove_vop( "fame" );
+#endif
 	if ( video_driver_list && !gstrcmp( video_driver_list[0],"dxr3" ) )
 	 {
 	  if ( ( guiIntfStruct.StreamType != STREAMTYPE_DVD)&&( guiIntfStruct.StreamType != STREAMTYPE_VCD ) )
 	   {
+#ifdef USE_LIBAVCODEC
 	    if ( gtkVopLAVC ) add_vop( "lavc" );
+#endif
+#ifdef USE_LIBFAME
 	    if ( gtkVopFAME ) add_vop( "fame" );
+#endif
 	   }
 	 }
 #endif
@@ -540,7 +567,6 @@
 	 else remove_vop( "pp" );
 		 
 // --- audio opts
-	audio_delay=gtkAODelay;
 //	if ( ao_plugin_cfg.plugin_list ) { free( ao_plugin_cfg.plugin_list ); ao_plugin_cfg.plugin_list=NULL; }
 	if ( gtkAONorm ) 	       gset( &ao_plugin_cfg.plugin_list,"volnorm" );
 	if ( gtkEnableAudioEqualizer ) gset( &ao_plugin_cfg.plugin_list,"eq" );
@@ -578,14 +604,10 @@
  return False;
 }
 
-extern unsigned int GetTimerMS( void );
-extern int mplTimer;
-
 void guiEventHandling( void )
 {
  if ( !guiIntfStruct.Playing || guiIntfStruct.NoWindow ) wsHandleEvents();
  gtkEventHandling();
- mplTimer=GetTimerMS() / 20;
 }
 
 // --- 
@@ -701,18 +723,6 @@
          } else { url_item->next=NULL; URLList=url_item; }
         return NULL;
 // --- subtitle
-   case gtkSetSubAuto:
-        sub_auto=(int)fparam;
-	return NULL;
-   case gtkSetSubDelay:
-        sub_delay=fparam;
-        return NULL;   
-   case gtkSetSubFPS:
-        sub_fps=(int)fparam;
-        return NULL;   
-   case gtkSetSubPos:
-        sub_pos=(int)fparam;
-        return NULL;   
 #if defined( USE_OSD ) || defined( USE_SUB )
 #ifndef HAVE_FREETYPE
    case gtkSetFontFactor:
@@ -763,16 +773,10 @@
 	if ( (unsigned int)vparam & guiVCD ) guiIntfStruct.VCDTracks=0;
 #endif
 	return NULL;
-   case gtkSetCacheSize:
-        stream_cache_size=(int)fparam;
-	return NULL;
    case gtkSetExtraStereo:
         gtkAOExtraStereoMul=fparam;
 	audio_plugin_extrastereo.control( AOCONTROL_PLUGIN_ES_SET,(int)&gtkAOExtraStereoMul );
         return NULL;
-   case gtkSetAudioDelay:
-        audio_delay=gtkAODelay=fparam;
-	return NULL;
    case gtkSetPanscan:
         {
 	 mp_cmd_t * mp_cmd;
--- a/Gui/interface.h	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/interface.h	Sat Nov 02 16:09:05 2002 +0000
@@ -161,34 +161,28 @@
 
 extern URLItem * URLList;
 
-#define gtkSetContrast     0
-#define gtkSetBrightness   1
-#define gtkSetHue	   2
-#define gtkSetSaturation   3
-#define gtkSetEqualizer    4
-#define gtkAddPlItem       5
-#define gtkGetNextPlItem   6
-#define gtkGetPrevPlItem   7
-#define gtkGetCurrPlItem   8
-#define gtkDelPl           9
-#define gtkSetExtraStereo 10
-#define gtkSetAudioDelay  11
-#define gtkSetPanscan     12
-#define gtkSetSubDelay    13
-#define gtkSetSubFPS      14
-#define gtkSetSubPos      15
-#define gtkSetSubAuto     16
-#define gtkSetFontFactor  17
-#define gtkSetAutoq       18
-#define gtkClearStruct    19
-#define gtkAddURLItem     20
-#define gtkSetFontOutLine 21
-#define gtkSetFontBlur    22
-#define gtkSetFontTextScale 23
-#define gtkSetFontOSDScale  24
-#define gtkSetFontEncoding  25
-#define gtkSetFontAutoScale 26
-#define gtkSetCacheSize     27
+#define gtkSetContrast       0
+#define gtkSetBrightness     1
+#define gtkSetHue	     2
+#define gtkSetSaturation     3
+#define gtkSetEqualizer      4
+#define gtkAddPlItem         5
+#define gtkGetNextPlItem     6
+#define gtkGetPrevPlItem     7
+#define gtkGetCurrPlItem     8
+#define gtkDelPl             9
+#define gtkSetExtraStereo   10
+#define gtkSetPanscan       11
+#define gtkSetFontFactor    12
+#define gtkSetAutoq         13
+#define gtkClearStruct      14
+#define gtkAddURLItem       15
+#define gtkSetFontOutLine   16
+#define gtkSetFontBlur      17
+#define gtkSetFontTextScale 18
+#define gtkSetFontOSDScale  19
+#define gtkSetFontEncoding  20
+#define gtkSetFontAutoScale 21
 
 extern float gtkEquChannels[6][10];
 
--- a/Gui/mplayer/gtk/about.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/mplayer/gtk/about.c	Sat Nov 02 16:09:05 2002 +0000
@@ -1,5 +1,5 @@
 
-#include "../../events.h"
+#include "../../app.h"
 #include "../../../config.h"
 #include "../../../help_mp.h"
 
--- a/Gui/mplayer/gtk/eq.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/mplayer/gtk/eq.c	Sat Nov 02 16:09:05 2002 +0000
@@ -9,7 +9,7 @@
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
 
-#include "../../events.h"
+#include "../../app.h"
 #include "../../cfg.h"
 #include "../../help_mp.h"
 #include "../../../config.h"
@@ -290,7 +290,7 @@
 
   accel_group=gtk_accel_group_new();
 
-  Equalizer=gtk_window_new( GTK_WINDOW_DIALOG );
+  Equalizer=gtk_window_new( GTK_WINDOW_TOPLEVEL );
   gtk_widget_set_name( Equalizer,MSGTR_Equalizer );
   gtk_object_set_data( GTK_OBJECT( Equalizer ),MSGTR_Equalizer,Equalizer );
   gtk_widget_set_usize( Equalizer,550,256 );
@@ -846,7 +846,7 @@
 
   accel_group=gtk_accel_group_new();
 
-  EquConfig=gtk_window_new( GTK_WINDOW_DIALOG );
+  EquConfig=gtk_window_new( GTK_WINDOW_TOPLEVEL );
   gtk_widget_set_name( EquConfig,"EquConfig" );
   gtk_object_set_data( GTK_OBJECT( EquConfig ),"EquConfig",EquConfig );
   gtk_widget_set_usize( EquConfig,350,198 );
--- a/Gui/mplayer/gtk/fs.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/mplayer/gtk/fs.c	Sat Nov 02 16:09:05 2002 +0000
@@ -12,7 +12,7 @@
 #include "mplayer/pixmaps/dir.xpm"
 #include "mplayer/pixmaps/file.xpm"
 
-#include "../../events.h"
+#include "../../app.h"
 #include "../../interface.h"
 #include "../../../config.h"
 #include "../../../help_mp.h"
--- a/Gui/mplayer/gtk/mb.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/mplayer/gtk/mb.c	Sat Nov 02 16:09:05 2002 +0000
@@ -1,5 +1,5 @@
 
-#include "../../events.h"
+#include "../../app.h"
 #include "../../../config.h"
 #include "../../../help_mp.h"
 
--- a/Gui/mplayer/gtk/menu.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/mplayer/gtk/menu.c	Sat Nov 02 16:09:05 2002 +0000
@@ -7,7 +7,7 @@
 #include "../../../help_mp.h"
 #include "../../../mplayer.h"
 
-#include "../../events.h"
+#include "../../app.h"
 
 #include "menu.h"
 #include "../widgets.h"
--- a/Gui/mplayer/gtk/opts.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/mplayer/gtk/opts.c	Sat Nov 02 16:09:05 2002 +0000
@@ -425,7 +425,7 @@
 	gtkAONorm=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNormalize ) );
 	gtkAONoSound=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoSound ) );
 	gtkSet( gtkSetExtraStereo,HSExtraStereoMuladj->value,NULL );
-	gtkSet( gtkSetAudioDelay,HSAudioDelayadj->value,NULL );
+	audio_delay=HSAudioDelayadj->value;
 
 	gaddlist( &audio_driver_list,ao_driver[0] );
 	gaddlist( &video_driver_list,vo_driver[0] );
@@ -442,13 +442,13 @@
 	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFlip ) ) ) flip=1;
 	
 	// -- 3. page
-	gtkSet( gtkSetSubAuto,!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoAutoSub ) ),NULL );
+	sub_auto=!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoAutoSub ) );
 	gtkSubDumpMPSub=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDumpMPSub ) );
 	gtkSubDumpSrt=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDumpSrt ) );
 	sub_unicode=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSubUnicode ) );
-	gtkSet( gtkSetSubDelay,HSSubDelayadj->value,NULL );
-	gtkSet( gtkSetSubFPS,HSSubFPSadj->value,NULL );
-	gtkSet( gtkSetSubPos,HSSubPositionadj->value,NULL );
+	sub_delay=HSSubDelayadj->value;
+	sub_fps=HSSubFPSadj->value;
+	sub_pos=(int)HSSubPositionadj->value;
 	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDNone ) ) ) osd_level=0;
 	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDIndicator ) ) ) osd_level=1;
 	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDTandP ) ) ) osd_level=2;
@@ -475,8 +475,8 @@
 	gtkLoadFullscreen=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ) );
 	gtkSet( gtkSetAutoq,HSPPQualityadj->value,NULL );
 
-	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) gtkSet( gtkSetCacheSize,SBCacheadj->value,NULL );
-	 else gtkSet( gtkSetCacheSize,0,NULL );
+	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) stream_cache_size=SBCacheadj->value;
+	 else stream_cache_size=0;
 
 	{
 	 int i;
@@ -529,16 +529,16 @@
 	gtkSet( gtkSetExtraStereo,HSExtraStereoMuladj->value,NULL );
 	break;
    case 1: // audio delay
-	gtkSet( gtkSetAudioDelay,HSAudioDelayadj->value,NULL );
+	audio_delay=HSAudioDelayadj->value;
 	break;
    case 2: // panscan
         gtkSet( gtkSetPanscan,HSPanscanadj->value,NULL );
 	break;
    case 3: // sub delay
-        gtkSet( gtkSetSubDelay,HSSubDelayadj->value,NULL );
+        sub_delay=HSSubDelayadj->value;
 	break;
    case 4: // sub position
-        gtkSet( gtkSetSubPos,HSSubPositionadj->value,NULL );
+        sub_pos=(int)HSSubPositionadj->value;
 	break;
    case 5: // font factor
 #ifndef HAVE_FREETYPE
@@ -682,14 +682,9 @@
 
   accel_group=gtk_accel_group_new();
 
-  Preferences=gtk_window_new( GTK_WINDOW_DIALOG );
+  Preferences=gtk_window_new( GTK_WINDOW_TOPLEVEL );
   gtk_widget_set_name( Preferences,"Preferences" );
   gtk_object_set_data( GTK_OBJECT( Preferences ),"Preferences",Preferences );
-//#ifndef HAVE_FREETYPE
-//  gtk_widget_set_usize( Preferences,512,400 );
-//#else
-//  gtk_widget_set_usize( Preferences,612,565 );
-//#endif
   gtk_window_set_title( GTK_WINDOW( Preferences ),MSGTR_Preferences );
   gtk_window_set_position( GTK_WINDOW( Preferences ),GTK_WIN_POS_CENTER );
 //  gtk_window_set_policy( GTK_WINDOW( Preferences ),FALSE,FALSE,FALSE );
@@ -2000,7 +1995,7 @@
 
   accel_group=gtk_accel_group_new();
 
-  OSSConfig=gtk_window_new( GTK_WINDOW_DIALOG );
+  OSSConfig=gtk_window_new( GTK_WINDOW_TOPLEVEL );
   gtk_widget_set_name( OSSConfig,"OSSConfig" );
   gtk_object_set_data( GTK_OBJECT( OSSConfig ),"OSSConfig",OSSConfig );
   gtk_widget_set_usize( OSSConfig,270,92 );
@@ -2184,8 +2179,12 @@
 static GtkWidget * CBDevice;
 static GtkWidget * CEDXR3Device;
 static GtkWidget * RBVNone;
-static GtkWidget * RBVLavc;
-static GtkWidget * RBVFame;
+#ifdef USE_LIBAVCODEC
+ static GtkWidget * RBVLavc;
+#endif
+#ifdef USE_LIBFAME
+ static GtkWidget * RBVFame;
+#endif
 static GtkWidget * dxr3BOk;
 static GtkWidget * dxr3BCancel;
 
@@ -2201,8 +2200,12 @@
  gtk_entry_set_text( GTK_ENTRY( CEDXR3Device ),gtkDXR3Device );
 
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVNone ),TRUE );
+#ifdef USE_LIBAVCODEC
  if ( gtkVopLAVC ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVLavc ),TRUE );
+#endif
+#ifdef USE_LIBFAME
  if ( gtkVopFAME ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVFame ),TRUE );
+#endif
  
  gtk_widget_show( DXR3Config );
  gtkSetLayer( DXR3Config );
@@ -2223,8 +2226,12 @@
  {
   case 0: // Ok
        gfree( (void **)&gtkDXR3Device ); gtkDXR3Device=strdup( gtk_entry_get_text( GTK_ENTRY( CEDXR3Device ) ) );
+#ifdef USE_LIBAVCODEC
        gtkVopLAVC=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBVLavc ) );
+#endif
+#ifdef USE_LIBFAME
        gtkVopFAME=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBVFame ) );
+#endif
   case 2: // Destroy
   case 1: // Cancel
        HideDXR3Config();
@@ -2259,10 +2266,10 @@
 
  accel_group=gtk_accel_group_new();
 
- DXR3Config=gtk_window_new( GTK_WINDOW_DIALOG );
+ DXR3Config=gtk_window_new( GTK_WINDOW_TOPLEVEL );
  gtk_widget_set_name( DXR3Config,"DXR3Config" );
  gtk_object_set_data( GTK_OBJECT( DXR3Config ),"DXR3Config",DXR3Config );
- gtk_widget_set_usize( DXR3Config,300,156 );
+// gtk_widget_set_usize( DXR3Config,300,156 );
  GTK_WIDGET_SET_FLAGS( DXR3Config,GTK_CAN_DEFAULT );
  gtk_window_set_title( GTK_WINDOW( DXR3Config ),"DXR3/H+" );
  gtk_window_set_position( GTK_WINDOW( DXR3Config ),GTK_WIN_POS_CENTER );
@@ -2357,6 +2364,7 @@
  gtk_widget_show( CEDXR3Device );
  gtk_entry_set_text( GTK_ENTRY( CEDXR3Device ),"/dev/em8300" );
 
+#if defined( USE_LIBAVCODEC ) || defined( USE_LIBFAME )
  hseparator2=gtk_hseparator_new();
  gtk_widget_set_name( hseparator2,"hseparator2" );
  gtk_widget_ref( hseparator2 );
@@ -2390,6 +2398,7 @@
  gtk_box_pack_start( GTK_BOX( vbox3 ),RBVNone,FALSE,FALSE,0 );
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVNone ),TRUE );
 
+#ifdef USE_LIBAVCODEC
  RBVLavc=gtk_radio_button_new_with_label( VEncoder_group,MSGTR_PREFERENCES_DXR3_LAVC );
  VEncoder_group=gtk_radio_button_group( GTK_RADIO_BUTTON( RBVLavc ) );
  gtk_widget_set_name( RBVLavc,"RBVLavc" );
@@ -2397,7 +2406,9 @@
  gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"RBVLavc",RBVLavc,(GtkDestroyNotify)gtk_widget_unref );
  gtk_widget_show( RBVLavc );
  gtk_box_pack_start( GTK_BOX( vbox3 ),RBVLavc,FALSE,FALSE,0 );
+#endif
 
+#ifdef USE_LIBFAME
  RBVFame=gtk_radio_button_new_with_label( VEncoder_group,MSGTR_PREFERENCES_DXR3_FAME );
  VEncoder_group=gtk_radio_button_group( GTK_RADIO_BUTTON( RBVFame ) );
  gtk_widget_set_name( RBVFame,"RBVFame" );
@@ -2405,6 +2416,8 @@
  gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"RBVFame",RBVFame,(GtkDestroyNotify)gtk_widget_unref );
  gtk_widget_show( RBVFame );
  gtk_box_pack_start( GTK_BOX( vbox3 ),RBVFame,FALSE,FALSE,0 );
+#endif
+#endif
 
  hseparator1=gtk_hseparator_new();
  gtk_widget_set_name( hseparator1,"hseparator1" );
@@ -2431,7 +2444,6 @@
  gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"dxr3BOk",dxr3BOk,(GtkDestroyNotify)gtk_widget_unref );
  gtk_widget_show( dxr3BOk );
  gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),dxr3BOk );
-// GTK_WIDGET_UNSET_FLAGS( bOk,GTK_CAN_FOCUS );
 
  dxr3BCancel=gtk_button_new_with_label( MSGTR_Cancel );
  gtk_widget_set_name( dxr3BCancel,"dxr3BCancel" );
@@ -2439,7 +2451,6 @@
  gtk_object_set_data_full( GTK_OBJECT( DXR3Config ),"dxr3BCancel",dxr3BCancel,(GtkDestroyNotify)gtk_widget_unref );
  gtk_widget_show( dxr3BCancel );
  gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),dxr3BCancel );
-// GTK_WIDGET_UNSET_FLAGS( bCancel,GTK_CAN_FOCUS );
 
  gtk_widget_add_accelerator( dxr3BOk,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
  gtk_widget_add_accelerator( dxr3BCancel,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
--- a/Gui/mplayer/gtk/pl.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/mplayer/gtk/pl.c	Sat Nov 02 16:09:05 2002 +0000
@@ -423,7 +423,7 @@
 
   accel_group=gtk_accel_group_new();
 
-  PlayList=gtk_window_new( GTK_WINDOW_DIALOG );
+  PlayList=gtk_window_new( GTK_WINDOW_TOPLEVEL );
   gtk_object_set_data( GTK_OBJECT( PlayList ),"PlayList",PlayList );
   gtk_widget_set_usize( PlayList,512,300 );
   gtk_window_set_title( GTK_WINDOW( PlayList ),MSGTR_PlayList );
--- a/Gui/mplayer/gtk/sb.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/mplayer/gtk/sb.c	Sat Nov 02 16:09:05 2002 +0000
@@ -7,7 +7,7 @@
 #include <stdio.h>
 
 #include "sb.h"
-#include "../../events.h"
+#include "../../app.h"
 #include "../../../config.h"
 #include "../../../help_mp.h"
 
@@ -135,7 +135,7 @@
 
  accel_group = gtk_accel_group_new ();
 
- SkinBrowser=gtk_window_new( GTK_WINDOW_DIALOG );
+ SkinBrowser=gtk_window_new( GTK_WINDOW_TOPLEVEL );
  gtk_widget_set_name( SkinBrowser,MSGTR_SkinBrowser );
  gtk_object_set_data( GTK_OBJECT( SkinBrowser ),MSGTR_SkinBrowser,SkinBrowser );
  gtk_widget_set_usize( SkinBrowser,256,320 );
--- a/Gui/mplayer/gtk/url.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/mplayer/gtk/url.c	Sat Nov 02 16:09:05 2002 +0000
@@ -11,7 +11,7 @@
 
 #include "url.h"
 #include "../../interface.h"
-#include "../../events.h"
+#include "../../app.h"
 #include "../widgets.h"
 #include "../../help_mp.h"
 
@@ -113,7 +113,7 @@
 
  accel_group=gtk_accel_group_new();
 
- URL=gtk_window_new( GTK_WINDOW_DIALOG );
+ URL=gtk_window_new( GTK_WINDOW_TOPLEVEL );
  gtk_widget_set_name( URL,"URL" );
  gtk_object_set_data( GTK_OBJECT( URL ),"URL",URL );
  gtk_widget_set_usize( URL,384,70 );
--- a/Gui/mplayer/mplayer.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/mplayer/mplayer.c	Sat Nov 02 16:09:05 2002 +0000
@@ -8,7 +8,6 @@
 #include <unistd.h>
 
 #include "./mplayer.h"
-#include "../events.h"
 #include "../app.h"
 #include "../cfg.h"
 #include "../interface.h"
@@ -34,7 +33,6 @@
 #define mplRedrawTimerConst 5
 
 int mplRedrawTimer = mplRedrawTimerConst;
-int mplTimer = 0;
 
 void mplEventHandling( int msg,float param );
 
@@ -49,20 +47,6 @@
 {
  int i;
 
-#if 0
- // init fields of this struct to default values
- guiIntfStruct.Balance=50.0f;
- guiIntfStruct.StreamType=-1;
-
- gtkInit();
-
- // read gui.conf, gui.pl
- cfg_read();
-
- // opens X display, checks for extensions (XShape, DGA etc)
- wsXInit( disp );
-#endif 
-
  if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
   {
    fprintf( stderr,MSGTR_NEMDB );
--- a/Gui/mplayer/mw.h	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/mplayer/mw.h	Sat Nov 02 16:09:05 2002 +0000
@@ -6,6 +6,8 @@
 #include "../../libvo/sub.h"
 #include "../../mplayer.h"
 
+extern unsigned int GetTimerMS( void );
+
 unsigned char * mplDrawBuffer = NULL;
 int             mplMainRender = 1;
 
@@ -195,7 +197,7 @@
             {
 	     char * t = Translate( item->label );
 	     int    l = fntTextWidth( item->fontid,t );
-             image=fntRender( item->fontid,mplTimer%(l?l:item->width),item->width,"%s",t );
+             image=fntRender( item->fontid,(GetTimerMS() / 20)%(l?l:item->width),item->width,"%s",t );
 	    }
 drawrenderedtext:
             if ( image )
--- a/Gui/mplayer/widgets.c	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/mplayer/widgets.c	Sat Nov 02 16:09:05 2002 +0000
@@ -18,7 +18,6 @@
 #include "widgets.h"
 
 #include "./mplayer.h"
-#include "../events.h"
 #include "../app.h"
 #include "../wm/ws.h"
 
@@ -63,7 +62,6 @@
 {
  mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] init gtk ...\n" );
  gtk_set_locale();
-// gtk_init( &argc,&argv );
  gtk_init( 0,NULL );
 // gdk_set_use_xshm( TRUE );
 
@@ -83,15 +81,8 @@
  gtkInited=1;
 }
 
-void gtkDone( void )
-{
-}
-
 void gtkAddIcon( GtkWidget * window )
-{
- GdkWindowPrivate * win = (GdkWindowPrivate *)window->window;
- wsSetIcon( gdk_display,win->xwindow,guiIcon,guiIconMask );
-}
+{ wsSetIcon( gdk_display,GDK_WINDOW_XWINDOW( window->window ),guiIcon,guiIconMask ); }
 
 void gtkClearList( GtkWidget * list )
 { gtk_clist_clear( GTK_CLIST( list ) ); }
@@ -159,16 +150,10 @@
 }
 
 void gtkSetLayer( GtkWidget * wdg )
-{
- GdkWindowPrivate * win = (GdkWindowPrivate *)wdg->window;
- wsSetLayer( gdk_display,win->xwindow,appMPlayer.subWindow.isFullScreen );
-}
+{ wsSetLayer( gdk_display,GDK_WINDOW_XWINDOW( wdg->window ),appMPlayer.subWindow.isFullScreen ); }
 
 void gtkActive( GtkWidget * wdg )
-{
- GdkWindowPrivate * win = (GdkWindowPrivate *)wdg->window;
- wsMoveTopWindow( gdk_display,win->xwindow );
-}
+{ wsMoveTopWindow( gdk_display,GDK_WINDOW_XWINDOW( wdg->window )); }
 
 void gtkShow( int type,char * param )
 {
--- a/Gui/mplayer/widgets.h	Sat Nov 02 16:00:21 2002 +0000
+++ b/Gui/mplayer/widgets.h	Sat Nov 02 16:09:05 2002 +0000
@@ -44,7 +44,6 @@
 extern void widgetsCreate( void );
 
 extern void gtkInit( void );
-extern void gtkDone( void );
 extern void gtkAddIcon( GtkWidget * window );
 
 extern int  gtkFillSkinList( gchar * dir );