mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 04:42:10 +00:00
middle menu is working
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2941 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
5b5be67bd4
commit
4332bed459
@ -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 * AddSeparator( GtkWidget * Menu )
|
||||
}
|
||||
|
||||
GtkWidget * DVDSubMenu;
|
||||
GtkWidget * DVDAudioLanguageMenu;
|
||||
GtkWidget * DVDSubtitleLanguageMenu;
|
||||
|
||||
GtkWidget * create_PopUpMenu( void )
|
||||
{
|
||||
@ -63,7 +66,7 @@ GtkWidget * create_PopUpMenu( void )
|
||||
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 @@ GtkWidget * create_PopUpMenu( void )
|
||||
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 );
|
||||
|
@ -11,6 +11,7 @@ extern unsigned char * mplMenuDrawBuffer;
|
||||
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 );
|
||||
|
@ -5,7 +5,9 @@
|
||||
|
||||
unsigned char * mplDrawBuffer = NULL;
|
||||
int mplMainRender = 1;
|
||||
|
||||
int mplMainAutoPlay = 0;
|
||||
int mplMiddleMenu = 0;
|
||||
|
||||
int mainVisible = 1;
|
||||
|
||||
@ -380,7 +382,14 @@ NoPause:
|
||||
mplMainRender=1;
|
||||
mplMainAutoPlay=0;
|
||||
mplPlay();
|
||||
break;
|
||||
}
|
||||
if ( mplMiddleMenu )
|
||||
{
|
||||
mplMiddleMenu=0;
|
||||
mplMsgHandle( gtkShMem->popupmenu,0 );
|
||||
break;
|
||||
}
|
||||
break;
|
||||
// --- system events
|
||||
case evNone:
|
||||
|
@ -127,10 +127,8 @@ void gtkSigHandler( int s )
|
||||
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 @@ void mplMainSigHandler( int s )
|
||||
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 ); }
|
||||
|
@ -40,7 +40,6 @@ int gtkVisibleFileSelect = 0;
|
||||
int gtkVisibleMessageBox = 0;
|
||||
int gtkVisibleAboutBox = 0;
|
||||
int gtkVisibleOptions = 0;
|
||||
int gtkVisiblePopUpMenu = 0;
|
||||
|
||||
gtkCommStruct * gtkShMem;
|
||||
|
||||
|
@ -52,6 +52,7 @@ typedef struct
|
||||
gtkSkinStruct sb;
|
||||
gtkVisibleStruct vs;
|
||||
gtkOptionsStruct op;
|
||||
int popupmenu;
|
||||
} gtkCommStruct;
|
||||
|
||||
extern gtkCommStruct * gtkShMem;
|
||||
@ -77,7 +78,6 @@ extern int gtkVisibleFileSelect;
|
||||
extern int gtkVisibleMessageBox;
|
||||
extern int gtkVisibleAboutBox;
|
||||
extern int gtkVisibleOptions;
|
||||
extern int gtkVisiblePopUpMenu;
|
||||
|
||||
extern char * sbMPlayerDirInHome;
|
||||
extern char * sbMPlayerPrefixDir;
|
||||
|
Loading…
Reference in New Issue
Block a user