summaryrefslogtreecommitdiffstats
path: root/Gui/mplayer
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-05-01 09:29:06 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-05-01 09:29:06 +0000
commit33d7a129df7f967637a6f6a3ce89f43b395b3938 (patch)
treecc4ab3ad2f1700824db3f5962521a42703d9ba0b /Gui/mplayer
parentd8751b2f38207e9589ab136cc589c8ccb02c7fb8 (diff)
downloadmpv-33d7a129df7f967637a6f6a3ce89f43b395b3938.tar.bz2
mpv-33d7a129df7f967637a6f6a3ce89f43b395b3938.tar.xz
some bug fix
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5920 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui/mplayer')
-rw-r--r--Gui/mplayer/menu.h6
-rw-r--r--Gui/mplayer/mw.h7
-rw-r--r--Gui/mplayer/sw.h18
-rw-r--r--Gui/mplayer/widgets.c24
4 files changed, 34 insertions, 21 deletions
diff --git a/Gui/mplayer/menu.h b/Gui/mplayer/menu.h
index b8031dcb12..58a97bf469 100644
--- a/Gui/mplayer/menu.h
+++ b/Gui/mplayer/menu.h
@@ -5,7 +5,7 @@ int mplMenuItem = -1;
int mplOldMenuItem = -1;
int mplMenuX,mplMenuY;
-void mplHideMenu( int mx,int my );
+void mplHideMenu( int mx,int my,int w );
void mplMenuDraw( wsParamDisplay )
{
@@ -85,7 +85,7 @@ void mplShowMenu( int mx,int my )
wsPostRedisplay( &appMPlayer.menuWindow );
}
-void mplHideMenu( int mx,int my )
+void mplHideMenu( int mx,int my,int w )
{
int x,y,i=mplMenuItem;
@@ -107,7 +107,7 @@ void mplHideMenu( int mx,int my )
appMPlayer.MenuItems[i].x+appMPlayer.MenuItems[i].width,
appMPlayer.MenuItems[i].y+appMPlayer.MenuItems[i].height ) )
{
- mplEventHandling( appMPlayer.MenuItems[i].msg,0 );
+ mplEventHandling( appMPlayer.MenuItems[i].msg,(float)w );
}
}
diff --git a/Gui/mplayer/mw.h b/Gui/mplayer/mw.h
index 26fca17854..fbd4ea29bf 100644
--- a/Gui/mplayer/mw.h
+++ b/Gui/mplayer/mw.h
@@ -166,7 +166,7 @@ void mplMainDraw( wsParamDisplay )
PutImage( &item->Bitmap,item->x,item->y,3,item->pressed );
break;
case itPotmeter:
- PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( item->value / 100.0f ) );
+ PutImage( &item->Bitmap,item->x,item->y,item->phases,( item->phases - 1 ) * ( item->value / 100.0f ) );
break;
case itHPotmeter:
PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( item->value / 100.0f ) );
@@ -177,11 +177,10 @@ void mplMainDraw( wsParamDisplay )
goto drawrenderedtext;
case itDLabel:
image=fntRender( item->fontid,mplTimer%item->width,item->width,"%s",Translate( item->label ) );
-//// image=fntRender( item->fontid,( mplRedrawTimer / 10 )%item->width,item->width,"%s",Translate( item->label ) );
drawrenderedtext:
- PutImage( image,item->x,item->y,1,0 );
if ( image )
{
+ PutImage( image,item->x,item->y,1,0 );
if ( image->Image ) free( image->Image );
free( image );
}
@@ -428,7 +427,7 @@ void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
itemtype=itPRMButton;
break;
case wsRRMouseButton:
- mplHideMenu( RX,RY );
+ mplHideMenu( RX,RY,0 );
break;
case wsPLMouseButton:
diff --git a/Gui/mplayer/sw.h b/Gui/mplayer/sw.h
index 95848a9cb7..fd780cec9e 100644
--- a/Gui/mplayer/sw.h
+++ b/Gui/mplayer/sw.h
@@ -6,6 +6,8 @@ int SubVisible = 0;
void mplSubDraw( wsParamDisplay )
{
+ if ( appMPlayer.subWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit );
+
if ( appMPlayer.subWindow.State == wsWindowFocusIn ) SubVisible++;
if ( !appMPlayer.subWindow.Mapped ||
@@ -37,7 +39,7 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
msButton=wsPRMouseButton;
break;
case wsRRMouseButton:
- mplHideMenu( RX,RY );
+ mplHideMenu( RX,RY,1 );
msButton=0;
break;
// ---
@@ -67,9 +69,9 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
}
break;
case wsRLMouseButton:
-// if ( ( !mplSubMoved )&&( ( SubVisible++%2 ) ) ) wsMoveTopWindow( &appMPlayer.mainWindow );
if ( !mplSubMoved )
{
+#if 0
if( SubVisible++%2 )
{
wsMoveTopWindow( &appMPlayer.mainWindow );
@@ -80,6 +82,18 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
wsMoveTopWindow( &appMPlayer.subWindow );
fprintf( stderr,"[sw] SUB TOP\n" );
}
+#else
+ if ( appMPlayer.subWindow.Focused == 2 )
+ {
+ wsMoveTopWindow( &appMPlayer.mainWindow );
+ fprintf( stderr,"[sw] MAIN TOP\n" );
+ }
+ else
+ {
+ wsMoveTopWindow( &appMPlayer.subWindow );
+ fprintf( stderr,"[sw] SUB TOP\n" );
+ }
+#endif
}
msButton=0;
mplSubMoved=0;
diff --git a/Gui/mplayer/widgets.c b/Gui/mplayer/widgets.c
index 0f8b226ad6..ce7bd7fbf4 100644
--- a/Gui/mplayer/widgets.c
+++ b/Gui/mplayer/widgets.c
@@ -40,6 +40,7 @@ GtkWidget * ErrorPixmap;
int gtkPopupMenu = 0;
int gtkPopupMenuParam = 0;
+int gtkInited = 0;
#include "gtk/sb.h"
#include "gtk/pl.h"
@@ -49,25 +50,23 @@ int gtkPopupMenuParam = 0;
#include "gtk/opts.h"
#include "gtk/menu.h"
-void widgetsCreate( void )
-{
- AboutBox=create_About();
- SkinBrowser=create_SkinBrowser();
- PlayList=create_PlayList();
- FileSelect=create_FileSelect();
- MessageBox=create_MessageBox(0);
- Options=create_Options();
-// PopUpMenu=create_PopUpMenu();
-}
-
// --- init & close gtk
void gtkInit( int argc,char* argv[], char *envp[] )
{
+ mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] init gtk ...\n" );
gtk_set_locale();
gtk_init( &argc,&argv );
gdk_set_use_xshm( FALSE );
- widgetsCreate();
+
+ mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] Create about box.\n" ); AboutBox=create_About();
+ mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] Create skin browser.\n" ); SkinBrowser=create_SkinBrowser();
+ mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] Create playlist.\n" ); PlayList=create_PlayList();
+ mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] Create file selector.\n" ); FileSelect=create_FileSelect();
+ mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] Create message box.\n" ); MessageBox=create_MessageBox(0);
+ mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] Create preferences dialog box.\n" ); Options=create_Options();
+
+ gtkInited=1;
}
void gtkDone( void )
@@ -105,6 +104,7 @@ void gtkEventHandling( void )
void gtkMessageBox( int type,gchar * str )
{
+ if ( !gtkInited ) return;
gtk_label_set_text( GTK_LABEL( gtkMessageBoxText ),str );
gtk_widget_hide( MessageBox );
switch( type)