summaryrefslogtreecommitdiffstats
path: root/Gui
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-02-01 16:42:02 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-02-01 16:42:02 +0000
commit300a1416e572db7a51902127a512b62fd08374ed (patch)
tree42cf0af2950d9f4737890c632a62448070fab775 /Gui
parentd4408eac05ace7f78c0536e37184177a400bd952 (diff)
downloadmpv-300a1416e572db7a51902127a512b62fd08374ed.tar.bz2
mpv-300a1416e572db7a51902127a512b62fd08374ed.tar.xz
- rewrite Jan Spitalnik's patch
- fix some nice 10l git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9203 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui')
-rw-r--r--Gui/app.c7
-rw-r--r--Gui/cfg.c2
-rw-r--r--Gui/cfg.h1
-rw-r--r--Gui/interface.c48
-rw-r--r--Gui/mplayer/gtk/fs.c1
-rw-r--r--Gui/mplayer/gtk/menu.c14
-rw-r--r--Gui/mplayer/gtk/opts.c23
-rw-r--r--Gui/mplayer/mw.c13
-rw-r--r--Gui/mplayer/play.c31
9 files changed, 94 insertions, 46 deletions
diff --git a/Gui/app.c b/Gui/app.c
index 616de1cd7b..c85e9fe0cc 100644
--- a/Gui/app.c
+++ b/Gui/app.c
@@ -210,6 +210,9 @@ void btnSet( int event,int set )
{
int j;
for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
- if ( appMPlayer.Items[j].msg == event ) appMPlayer.Items[j].pressed=set;
+ if ( appMPlayer.Items[j].msg == event )
+ { appMPlayer.Items[j].pressed=set; appMPlayer.barItems[j].tmp=0; }
+ for ( j=0;j<appMPlayer.NumberOfBarItems + 1;j++ )
+ if ( appMPlayer.barItems[j].msg == event )
+ { appMPlayer.barItems[j].pressed=set; appMPlayer.barItems[j].tmp=0; }
}
- \ No newline at end of file
diff --git a/Gui/cfg.c b/Gui/cfg.c
index 62c03adaf4..0944495d4e 100644
--- a/Gui/cfg.c
+++ b/Gui/cfg.c
@@ -57,6 +57,7 @@ int gtkSubDumpMPSub = 0;
int gtkSubDumpSrt = 0;
int gtkLoadFullscreen = 0;
+int gtkShowVideoWindow = 1;
int gtkEnablePlayBar = 1;
// ---
@@ -133,6 +134,7 @@ static config_t gui_opts[] =
{ "playbar",&gtkEnablePlayBar,CONF_TYPE_FLAG,0,0,1,NULL },
{ "load_fullscreen",&gtkLoadFullscreen,CONF_TYPE_FLAG,0,0,1,NULL },
+ { "show_videowin", &gtkShowVideoWindow,CONF_TYPE_FLAG,0,0,1,NULL },
{ "stopxscreensaver",&stop_xscreensaver,CONF_TYPE_FLAG,0,0,1,NULL },
{ "autosync",&gtkAutoSyncOn,CONF_TYPE_FLAG,0,0,1,NULL },
diff --git a/Gui/cfg.h b/Gui/cfg.h
index 1035595886..136cec89b0 100644
--- a/Gui/cfg.h
+++ b/Gui/cfg.h
@@ -39,6 +39,7 @@ extern char * gtkEquChannel4;
extern char * gtkEquChannel5;
extern char * gtkEquChannel6;
extern int gtkLoadFullscreen;
+extern int gtkShowVideoWindow;
extern int gtkEnablePlayBar;
extern int cfg_read( void );
diff --git a/Gui/interface.c b/Gui/interface.c
index 45430888ab..ab9bc5f1a2 100644
--- a/Gui/interface.c
+++ b/Gui/interface.c
@@ -193,10 +193,10 @@ void guiInit( void )
fprintf( stderr,MSGTR_NEMDB );
exit( 0 );
}
-
+
wsCreateWindow( &appMPlayer.subWindow,
appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height,
- wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"ViDEO" );
+ wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"MPlayer - Video" );
wsDestroyImage( &appMPlayer.subWindow );
wsCreateImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height );
@@ -249,7 +249,7 @@ void guiInit( void )
if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 );
wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
-#if 1
+#if 0
wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
{
@@ -264,6 +264,38 @@ void guiInit( void )
mplFullScreen();
btnModify( evFullScreen,btnPressed );
}
+#else
+ if ( gtkShowVideoWindow )
+ {
+ wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
+ {
+ XEvent xev;
+ do { XNextEvent( wsDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID );
+ appMPlayer.subWindow.Mapped=wsMapped;
+ }
+
+ if ( fullscreen )
+ {
+ mplFullScreen();
+ btnModify( evFullScreen,btnPressed );
+ }
+ }
+ else
+ {
+ if ( fullscreen )
+ {
+ wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
+ {
+ XEvent xev;
+ do { XNextEvent( wsDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID );
+ appMPlayer.subWindow.Mapped=wsMapped;
+ }
+ wsVisibleWindow( &appMPlayer.subWindow, wsShowWindow );
+
+ mplFullScreen();
+ btnModify( evFullScreen,btnPressed );
+ }
+ }
#endif
mplSubRender=1;
// ---
@@ -442,8 +474,14 @@ int guiGetEvent( int type,char * arg )
case guiCEvent:
switch ( (int)arg )
{
- case guiSetPlay: guiIntfStruct.Playing=1; break;
- case guiSetStop: guiIntfStruct.Playing=0; break;
+ case guiSetPlay:
+ guiIntfStruct.Playing=1;
+ if ( !gtkShowVideoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
+ break;
+ case guiSetStop:
+ guiIntfStruct.Playing=0;
+ if ( !gtkShowVideoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
+ break;
case guiSetPause: guiIntfStruct.Playing=2; break;
}
mplState();
diff --git a/Gui/mplayer/gtk/fs.c b/Gui/mplayer/gtk/fs.c
index 60cbdab4a7..e4b6e6f041 100644
--- a/Gui/mplayer/gtk/fs.c
+++ b/Gui/mplayer/gtk/fs.c
@@ -514,6 +514,7 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
}
if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() );
if ( mplMainAutoPlay ) { mplMainAutoPlay=0; mplEventHandling( evPlay,0 ); }
+ else guiGetEvent( guiCEvent,guiSetStop );
}
void fs_Cancel_released( GtkButton * button,gpointer user_data )
diff --git a/Gui/mplayer/gtk/menu.c b/Gui/mplayer/gtk/menu.c
index a8c6347140..0f4c33ba8a 100644
--- a/Gui/mplayer/gtk/menu.c
+++ b/Gui/mplayer/gtk/menu.c
@@ -286,6 +286,7 @@ GtkWidget * create_PopUpMenu( void )
GtkWidget * Menu = NULL;
GtkWidget * SubMenu = NULL;
GtkWidget * MenuItem = NULL;
+ GtkWidget * N, * D, * F;
Menu=gtk_menu_new();
@@ -478,9 +479,16 @@ GtkWidget * create_PopUpMenu( void )
( appMPlayer.subWindow.Height == guiIntfStruct.MovieHeight * 2 ) ) b2=1;
else b1=1;
} else b1=!appMPlayer.subWindow.isFullScreen;
- AddMenuCheckItem( Menu,MSGTR_MENU_NormalSize" ",b1,evNormalSize );
- AddMenuCheckItem( Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize );
- AddMenuCheckItem( Menu,MSGTR_MENU_FullScreen,appMPlayer.subWindow.isFullScreen,evFullScreen );
+ N=AddMenuCheckItem( Menu,MSGTR_MENU_NormalSize" ",b1,evNormalSize );
+ D=AddMenuCheckItem( Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize );
+ F=AddMenuCheckItem( Menu,MSGTR_MENU_FullScreen,appMPlayer.subWindow.isFullScreen,evFullScreen );
+ }
+
+ if ( !gtkShowVideoWindow && !guiIntfStruct.Playing )
+ {
+ gtk_widget_set_sensitive( N,FALSE );
+ gtk_widget_set_sensitive( D,FALSE );
+ gtk_widget_set_sensitive( F,FALSE );
}
AddSeparator( Menu );
diff --git a/Gui/mplayer/gtk/opts.c b/Gui/mplayer/gtk/opts.c
index 60f58d4f78..682c888bf5 100644
--- a/Gui/mplayer/gtk/opts.c
+++ b/Gui/mplayer/gtk/opts.c
@@ -57,6 +57,7 @@ static GtkWidget * CBDR;
static GtkWidget * CBFramedrop;
static GtkWidget * CBHFramedrop;
//static GtkWidget * CBFullScreen;
+static GtkWidget * CBShowVideoWindow;
static GtkWidget * CBNonInterlaved;
static GtkWidget * CBIndex;
static GtkWidget * CBFlip;
@@ -351,6 +352,12 @@ void ShowPreferences( void )
// --- 6. page
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPostprocess ),gtkVopPP );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ),gtkLoadFullscreen );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ),gtkShowVideoWindow );
+ if ( !gtkShowVideoWindow )
+ {
+ gtk_widget_set_sensitive( CBLoadFullscreen,FALSE );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ),0 );
+ }
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBStopXScreenSaver ),stop_xscreensaver );
gtk_adjustment_set_value( HSPPQualityadj,auto_quality );
@@ -406,6 +413,7 @@ void ShowPreferences( void )
gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)0 );
gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 );
gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)2 );
+ gtk_signal_connect( GTK_OBJECT( CBShowVideoWindow ),"toggled",GTK_SIGNAL_FUNC( prToggled ), (void*)3 );
#ifdef HAVE_FREETYPE
gtk_signal_connect( GTK_OBJECT( RBFontNoAutoScale ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)4 );
gtk_signal_connect( GTK_OBJECT( BRFontAutoScaleWidth ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)5 );
@@ -583,6 +591,7 @@ void prButton( GtkButton * button,gpointer user_data )
// --- 6. page
gtkVopPP=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPostprocess ) );
gtkLoadFullscreen=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ) );
+ gtkShowVideoWindow=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ) );
stop_xscreensaver=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBStopXScreenSaver ) );
gtkEnablePlayBar=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPlayBar ) );
gtkSet( gtkSetAutoq,HSPPQualityadj->value,NULL );
@@ -684,6 +693,19 @@ static void prToggled( GtkToggleButton * togglebutton,gpointer user_data )
// case 2: // equalizer
// if ( guiIntfStruct.Playing ) gtkMessageBox( GTK_MB_WARNING,"Please remember, this function need restart the playing." );
// break;
+ case 3:
+ if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ) ) ) gtk_widget_set_sensitive( CBLoadFullscreen,TRUE );
+ else
+ {
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ),0 );
+ gtk_widget_set_sensitive( CBLoadFullscreen,FALSE );
+ }
+ if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ) ) )
+ {
+ wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
+ gtkActive( Preferences );
+ } else wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
+ break;
case 4:
case 5:
case 6:
@@ -1171,6 +1193,7 @@ GtkWidget * create_Preferences( void )
AddFrame( NULL,GTK_SHADOW_NONE,
AddFrame( MSGTR_PREFERENCES_FRAME_Misc,GTK_SHADOW_ETCHED_OUT,vbox601,1 ),1 ),0 );
+ CBShowVideoWindow=AddCheckButton( MSGTR_PREFERENCES_ShowVideoWindow,vbox602 );
CBLoadFullscreen=AddCheckButton( MSGTR_PREFERENCES_LoadFullscreen,vbox602 );
CBStopXScreenSaver=AddCheckButton( MSGTR_PREFERENCES_XSCREENSAVER,vbox602 );
CBPlayBar=AddCheckButton( MSGTR_PREFERENCES_PlayBar,vbox602 );
diff --git a/Gui/mplayer/mw.c b/Gui/mplayer/mw.c
index 108570507e..a23a5c41ad 100644
--- a/Gui/mplayer/mw.c
+++ b/Gui/mplayer/mw.c
@@ -277,6 +277,7 @@ set_volume:
}
break;
case evDoubleSize:
+ btnSet( evFullScreen,btnReleased );
if ( guiIntfStruct.Playing )
{
appMPlayer.subWindow.isFullScreen=True;
@@ -288,6 +289,7 @@ set_volume:
}
break;
case evNormalSize:
+ btnSet( evFullScreen,btnReleased );
if ( guiIntfStruct.Playing )
{
appMPlayer.subWindow.isFullScreen=True;
@@ -299,15 +301,10 @@ set_volume:
break;
} else if ( !appMPlayer.subWindow.isFullScreen ) break;
case evFullScreen:
- for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
- {
- if ( appMPlayer.Items[j].msg == evFullScreen )
- {
- appMPlayer.Items[j].tmp=!appMPlayer.Items[j].tmp;
- appMPlayer.Items[j].pressed=appMPlayer.Items[j].tmp;
- }
- }
+ if ( !guiIntfStruct.Playing && !gtkShowVideoWindow ) break;
mplFullScreen();
+ if ( appMPlayer.subWindow.isFullScreen ) btnSet( evFullScreen,btnPressed );
+ else btnSet( evFullScreen,btnReleased );
break;
case evSetAspect:
diff --git a/Gui/mplayer/play.c b/Gui/mplayer/play.c
index 79d85e2333..f7ad980432 100644
--- a/Gui/mplayer/play.c
+++ b/Gui/mplayer/play.c
@@ -37,30 +37,7 @@ static int mplGotoTheNext = 1;
void mplFullScreen( void )
{
if ( guiIntfStruct.NoWindow && guiIntfStruct.Playing ) return;
-#if 0
- static int sx,sy;
-// if ( !guiIntfStruct.Playing )
- {
- wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
- if ( appMPlayer.subWindow.isFullScreen )
- {
- wsResizeWindow( &appMPlayer.subWindow,sx,sy );
- wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
- wsWindowDecoration( &appMPlayer.subWindow,appMPlayer.subWindow.Decorations );
- appMPlayer.subWindow.isFullScreen=0;
- }
- else
- {
- sx=appMPlayer.subWindow.Width; sy=appMPlayer.subWindow.Height;
- wsResizeWindow( &appMPlayer.subWindow,wsMaxX,wsMaxY );
- wsMoveWindow( &appMPlayer.subWindow,True,0,0 );
- wsWindowDecoration( &appMPlayer.subWindow,0 );
- appMPlayer.subWindow.isFullScreen=1;
- }
- vo_fs=appMPlayer.subWindow.isFullScreen;
- wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
- }// else { vo_x11_fullscreen(); appMPlayer.subWindow.isFullScreen=vo_fs; }
-#else
+
if ( ( guiIntfStruct.Playing )&&( appMPlayer.subWindow.isFullScreen ) )
{
appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight;
@@ -77,13 +54,11 @@ void mplFullScreen( void )
default: appMPlayer.subWindow.OldY=appMPlayer.sub.y; break;
}
}
- wsFullScreen( &appMPlayer.subWindow );
- vo_fs=appMPlayer.subWindow.isFullScreen;
+ if ( guiIntfStruct.Playing || gtkShowVideoWindow ) wsFullScreen( &appMPlayer.subWindow );
+ fullscreen=vo_fs=appMPlayer.subWindow.isFullScreen;
wsSetLayer( wsDisplay,appMPlayer.mainWindow.WindowID,appMPlayer.subWindow.isFullScreen );
wsSetLayer( wsDisplay,appMPlayer.menuWindow.WindowID,appMPlayer.subWindow.isFullScreen );
-#endif
- fullscreen=appMPlayer.subWindow.isFullScreen;
if ( guiIntfStruct.Playing ) wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 );
else wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.sub.R,appMPlayer.sub.G,appMPlayer.sub.B );
}