changeset 2940:1902b7ff9cdc

middle menu is working
author pontscho
date Fri, 16 Nov 2001 23:17:52 +0000
parents c691d76c6539
children 60c1b7c0ea21
files Gui/mplayer/gtk/menu.c Gui/mplayer/mplayer.h Gui/mplayer/mw.h Gui/mplayer/psignal.c Gui/mplayer/widgets.c Gui/mplayer/widgets.h
diffstat 6 files changed, 25 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/gtk/menu.c	Fri Nov 16 23:02:12 2001 +0000
+++ b/Gui/mplayer/gtk/menu.c	Fri Nov 16 23:17:52 2001 +0000
@@ -8,8 +8,9 @@
 
 void ActivateMenuItem( int Item )
 {
- gtkVisiblePopUpMenu=0;
- fprintf( stderr,"[menu] item: %d\n",Item );
+// fprintf( stderr,"[menu] item: %d\n",Item );
+ gtkShMem->popupmenu=Item;
+ gtkSendMessage( evShowPopUpMenu );
 }
 
 GtkWidget * AddMenuItem( GtkWidget * Menu,char * label,int Number )
@@ -51,6 +52,8 @@
 }
 
 GtkWidget * DVDSubMenu;
+GtkWidget * DVDAudioLanguageMenu;
+GtkWidget * DVDSubtitleLanguageMenu;
 
 GtkWidget * create_PopUpMenu( void )
 {
@@ -63,7 +66,7 @@
   AddMenuItem( Menu,"About MPlayer""      ", evAbout );
   AddSeparator( Menu );
    SubMenu=AddSubMenu( Menu,"Open ..." );
-    AddMenuItem( SubMenu,"Play file ...""    ", evLoad );
+    AddMenuItem( SubMenu,"Play file ...""    ", evLoadPlay );
     AddMenuItem( SubMenu,"Play VCD ...", evNone );
     AddMenuItem( SubMenu,"Play DVD ...", evNone );
     AddMenuItem( SubMenu,"Play URL ...", evNone );
@@ -86,10 +89,11 @@
     AddMenuItem( SubMenu,"Double size", evDoubleSize );
     AddMenuItem( SubMenu,"Fullscreen", evFullScreen );
    DVDSubMenu=AddSubMenu( Menu,"DVD" );
-    AddMenuItem( DVDSubMenu,"Play disc ...", evNone );
+    AddMenuItem( DVDSubMenu,"Play disc ...""    ", evNone );
     AddMenuItem( DVDSubMenu,"Show DVD Menu", evNone );
     AddSeparator( DVDSubMenu );
-    AddMenuItem( DVDSubMenu,"    ...      ", evNone );
+    DVDAudioLanguageMenu=AddSubMenu( DVDSubMenu,"Audio language" );
+    DVDSubtitleLanguageMenu=AddSubMenu( DVDSubMenu,"Subtitle language" );
   AddSeparator( Menu );
   AddMenuItem( Menu,"Playlist", evPlayList );
   AddMenuItem( Menu,"Skin browser", evSkinBrowser );
--- a/Gui/mplayer/mplayer.h	Fri Nov 16 23:02:12 2001 +0000
+++ b/Gui/mplayer/mplayer.h	Fri Nov 16 23:17:52 2001 +0000
@@ -11,6 +11,7 @@
 extern int             mainVisible;
 
 extern int             mplMainAutoPlay;
+extern int	       mplMiddleMenu;
 
 extern void mplInit( int argc,char* argv[], char *envp[], void* disp );
 extern void mplMsgHandle( int msg,float param );
--- a/Gui/mplayer/mw.h	Fri Nov 16 23:02:12 2001 +0000
+++ b/Gui/mplayer/mw.h	Fri Nov 16 23:17:52 2001 +0000
@@ -5,7 +5,9 @@
 
 unsigned char * mplDrawBuffer = NULL;
 int             mplMainRender = 1;
+
 int             mplMainAutoPlay = 0;
+int		mplMiddleMenu = 0;
 
 int             mainVisible = 1;
 
@@ -380,7 +382,14 @@
           mplMainRender=1;
           mplMainAutoPlay=0;
           mplPlay();
+	  break;
          }
+	if ( mplMiddleMenu )
+	 {
+	  mplMiddleMenu=0;
+	  mplMsgHandle( gtkShMem->popupmenu,0 );
+	  break;
+	 }
         break;
 // --- system events
    case evNone:
--- a/Gui/mplayer/psignal.c	Fri Nov 16 23:02:12 2001 +0000
+++ b/Gui/mplayer/psignal.c	Fri Nov 16 23:17:52 2001 +0000
@@ -127,10 +127,8 @@
 	gtk_main_quit();
         break;
    case evShowPopUpMenu:
-//	if ( gtkVisiblePopUpMenu ) gtk_widget_hide( PopUpMenu );
-//	gtk_widget_show( PopUpMenu );
+        gtkShMem->popupmenu=evNone;
         gtk_menu_popup( GTK_MENU( PopUpMenu ),NULL,NULL,NULL,NULL,0,0 );
-	gtkVisiblePopUpMenu=1;
 	break;
   }
  gtkShMem->message=0;
@@ -184,6 +182,10 @@
 	mplShMem->StreamType=STREAMTYPE_FILE;
         if ( mplMainAutoPlay ) mplGeneralTimer=1;
         break;
+   case evShowPopUpMenu:
+        fprintf( stderr,"[psignal] PopUpMenu: %d\n",gtkShMem->popupmenu );
+	mplMiddleMenu=1; mplGeneralTimer=1; 
+	break;
    case evMessageBox:
         if ( mplCriticalError )
          { gtkSendMessage( evExit ); exit( 1 ); }
--- a/Gui/mplayer/widgets.c	Fri Nov 16 23:02:12 2001 +0000
+++ b/Gui/mplayer/widgets.c	Fri Nov 16 23:17:52 2001 +0000
@@ -40,7 +40,6 @@
 int             gtkVisibleMessageBox = 0;
 int             gtkVisibleAboutBox = 0;
 int             gtkVisibleOptions = 0;
-int             gtkVisiblePopUpMenu = 0;
 
 gtkCommStruct * gtkShMem;
 
--- a/Gui/mplayer/widgets.h	Fri Nov 16 23:02:12 2001 +0000
+++ b/Gui/mplayer/widgets.h	Fri Nov 16 23:17:52 2001 +0000
@@ -52,6 +52,7 @@
  gtkSkinStruct         sb;
  gtkVisibleStruct      vs;
  gtkOptionsStruct      op;
+ int		       popupmenu;
 } gtkCommStruct;
 
 extern gtkCommStruct * gtkShMem;
@@ -77,7 +78,6 @@
 extern int             gtkVisibleMessageBox;
 extern int             gtkVisibleAboutBox;
 extern int             gtkVisibleOptions;
-extern int             gtkVisiblePopUpMenu;
 
 extern char          * sbMPlayerDirInHome;
 extern char          * sbMPlayerPrefixDir;