]> git.sesse.net Git - vlc/commitdiff
* modules/gui/skins/*, modules/gui/wxwindows/*: added the wxWin popup menu to the...
authorGildas Bazin <gbazin@videolan.org>
Thu, 5 Jun 2003 21:22:28 +0000 (21:22 +0000)
committerGildas Bazin <gbazin@videolan.org>
Thu, 5 Jun 2003 21:22:28 +0000 (21:22 +0000)
13 files changed:
modules/gui/skins/Modules.am
modules/gui/skins/src/dialogs.cpp
modules/gui/skins/src/dialogs.h
modules/gui/skins/src/skin_common.h
modules/gui/skins/src/themeloader.cpp
modules/gui/wxwindows/fileinfo.cpp
modules/gui/wxwindows/interface.cpp
modules/gui/wxwindows/menus.cpp
modules/gui/wxwindows/messages.cpp
modules/gui/wxwindows/preferences.cpp
modules/gui/wxwindows/timer.cpp
modules/gui/wxwindows/wxwindows.cpp
modules/gui/wxwindows/wxwindows.h

index c93932c1a1e7d8bd1e5d26d7152d12b275ec82bc..6faba4158dce3c437ed81aa49392c6e5131c2320 100644 (file)
@@ -118,6 +118,7 @@ SOURCES_skins = \
        modules/gui/wxwindows/preferences.cpp \
        modules/gui/wxwindows/streamout.cpp \
        modules/gui/wxwindows/subtitles.cpp \
+       modules/gui/wxwindows/menus.cpp \
        $(NULL)
 
 SOURCES_basic_skins = \
index d63039758d1292caecc3c021dc0cbfc1ddced242..b31b12c8fe29e925097093e1a9a447c0c696f6d4 100644 (file)
@@ -2,10 +2,9 @@
  * dialogs.cpp: Handles all the different dialog boxes we provide.\r
  *****************************************************************************\r
  * Copyright (C) 2003 VideoLAN\r
- * $Id: dialogs.cpp,v 1.2 2003/06/04 16:03:33 gbazin Exp $\r
+ * $Id: dialogs.cpp,v 1.3 2003/06/05 21:22:27 gbazin Exp $\r
  *\r
- * Authors: Olivier Teulière <ipkiss@via.ecp.fr>\r
- *          Emmanuel Puig    <karibu@via.ecp.fr>\r
+ * Authors: Gildas Bazin <gbazin@netcourrier.com>\r
  *\r
  * This program is free software; you can redistribute it and/or modify\r
  * it under the terms of the GNU General Public License as published by\r
@@ -66,6 +65,7 @@ void Dialogs::ShowFileInfo(){}
 #define ShowMessages_Event 2\r
 #define ShowPrefs_Event    3\r
 #define ShowFileInfo_Event 4\r
+#define ShowPopup_Event    5\r
 #define ExitThread_Event   99\r
 \r
 //---------------------------------------------------------------------------\r
@@ -103,6 +103,7 @@ BEGIN_EVENT_TABLE(Instance, wxApp)
     EVT_COMMAND(ShowMessages_Event, wxEVT_DIALOG, Dialogs::OnShowMessages)\r
     EVT_COMMAND(ShowPrefs_Event, wxEVT_DIALOG, Dialogs::OnShowPrefs)\r
     EVT_COMMAND(ShowFileInfo_Event, wxEVT_DIALOG, Dialogs::OnShowFileInfo)\r
+    EVT_COMMAND(ShowPopup_Event, wxEVT_DIALOG, Dialogs::OnShowPopup)\r
     EVT_COMMAND(ExitThread_Event, wxEVT_DIALOG, Dialogs::OnExitThread)\r
 END_EVENT_TABLE()\r
 \r
@@ -161,10 +162,14 @@ bool Instance::OnInit()
     if( p_playlist != NULL )\r
     {\r
         var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB,\r
-                        p_intf->p_sys->p_dialogs );\r
+                         p_intf->p_sys->p_dialogs );\r
         vlc_object_release( p_playlist );\r
     }\r
 \r
+    /* Intercept all menu events in our custom event handler */\r
+    p_intf->p_sys->p_dialogs->OpenDlg->PushEventHandler(\r
+        new MenuEvtHandler( p_intf, NULL ) );\r
+\r
     return TRUE;\r
 }\r
 \r
@@ -234,7 +239,7 @@ Dialogs::Dialogs( intf_thread_t *_p_intf )
 \r
     // Create a new thread for wxWindows\r
     if( vlc_thread_create( p_thread, "Skins Dialogs Thread",\r
-                          SkinsDialogsThread, 0, VLC_TRUE ) )\r
+                           SkinsDialogsThread, 0, VLC_TRUE ) )\r
     {\r
         OpenDlg = NULL;\r
         msg_Err( p_intf, "cannot create SkinsDialogsThread" );\r
@@ -381,6 +386,20 @@ void Dialogs::OnShowFileInfo( wxCommandEvent& event )
     p_dialogs->FileInfoDlg->Show( !p_dialogs->FileInfoDlg->IsShown() );\r
 }\r
 \r
+void Dialogs::OnShowPopup( wxCommandEvent& event )\r
+{\r
+    Dialogs *p_dialogs = (Dialogs *)event.GetClientData();\r
+\r
+    wxPoint mousepos = wxGetMousePosition();\r
+\r
+    wxMouseEvent mouseevent = wxMouseEvent( wxEVT_RIGHT_UP );\r
+    mouseevent.m_x = p_dialogs->OpenDlg->ScreenToClient(mousepos).x;\r
+    mouseevent.m_y = p_dialogs->OpenDlg->ScreenToClient(mousepos).y;\r
+\r
+    ::PopupMenu( p_dialogs->p_intf,\r
+                 p_dialogs->OpenDlg, mouseevent.GetPosition() );\r
+}\r
+\r
 void Dialogs::OnExitThread( wxCommandEvent& event )\r
 {\r
     wxTheApp->ExitMainLoop();\r
@@ -397,7 +416,12 @@ int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
 {\r
     Dialogs *p_dialogs = (Dialogs *)param;\r
 \r
-    p_dialogs->b_popup_change = VLC_TRUE;\r
+#ifndef BASIC_SKINS\r
+    wxCommandEvent event( wxEVT_DIALOG, ShowPopup_Event );\r
+    event.SetClientData( p_dialogs );\r
+\r
+    wxTheApp->AddPendingEvent( event );\r
+#endif // BASIC_SKINS\r
 \r
     return VLC_SUCCESS;\r
 }\r
index 71fab8eede9aa68f9f50601e436ca06d23102566..d5a99ab67b5a70bee23ceb224b6212f739160d4a 100644 (file)
@@ -2,7 +2,7 @@
  * dialogs.h: Dialogs class\r
  *****************************************************************************\r
  * Copyright (C) 2003 VideoLAN\r
- * $Id: dialogs.h,v 1.2 2003/06/04 16:03:33 gbazin Exp $\r
+ * $Id: dialogs.h,v 1.3 2003/06/05 21:22:27 gbazin Exp $\r
  *\r
  * Authors: Gildas Bazin <gbazin@netcourrier.com>\r
  *\r
@@ -93,6 +93,7 @@ class Dialogs
         void OnShowMessages( wxCommandEvent& event );\r
         void OnShowPrefs( wxCommandEvent& event );\r
         void OnShowFileInfo( wxCommandEvent& event );\r
+        void OnShowPopup( wxCommandEvent& event );\r
         void OnExitThread( wxCommandEvent& event );\r
 #endif\r
 };\r
index 3780028bbc2ce7375459665394d5f0394b36dddc..9f84548556901487ed6f4b5c4ee51dae08deee67 100644 (file)
@@ -2,7 +2,7 @@
  * skin_common.h: Private Skin interface description
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: skin_common.h,v 1.14 2003/06/04 16:03:33 gbazin Exp $
+ * $Id: skin_common.h,v 1.15 2003/06/05 21:22:27 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -32,6 +32,7 @@
 
 class Theme;
 class Dialogs;
+class wxMenu;
 class wxIcon;
 
 #ifdef X11_SKINS
@@ -67,6 +68,12 @@ struct intf_sys_t
     // Interface dialogs
     Dialogs *p_dialogs;
 
+    // Popup menu
+    vlc_bool_t b_popup_change;
+#ifndef BASIC_SKINS
+    wxMenu     *p_popup_menu;
+#endif
+
 #ifndef BASIC_SKINS
     wxIcon      *p_icon;
 #endif
index f8cc5a39f0e86749776b2867d5ed53cd95839eee..9062637f9f722dd1c2f0209efa93020a1ae21fa9 100644 (file)
@@ -2,7 +2,7 @@
  * themeloader.cpp: ThemeLoader class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: themeloader.cpp,v 1.10 2003/05/24 20:54:27 gbazin Exp $
+ * $Id: themeloader.cpp,v 1.11 2003/06/05 21:22:27 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -334,7 +334,7 @@ int tar_extract_all( TAR *t, char *prefix )
         if(len != BLOCKSIZE)
         {
             fprintf(stderr, "gzread: incomplete block read");
-            return -1;
+            //return -1;
         }
 
         /*
index 9679c44123795cbfb4dd03951287d90db813717d..070980ebf97fd71d99092a26878969d7eab8db27 100644 (file)
@@ -2,7 +2,7 @@
  * fileinfo.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: fileinfo.cpp,v 1.14 2003/05/12 17:33:19 gbazin Exp $
+ * $Id: fileinfo.cpp,v 1.15 2003/06/05 21:22:27 gbazin Exp $
  *
  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
  *
@@ -73,8 +73,8 @@ END_EVENT_TABLE()
 /*****************************************************************************
  * Constructor.
  *****************************************************************************/
-FileInfo::FileInfo( intf_thread_t *_p_intf, Interface *_p_main_interface ):
-    wxFrame( _p_main_interface, -1, wxU(_("FileInfo")), wxDefaultPosition,
+FileInfo::FileInfo( intf_thread_t *_p_intf, wxWindow *p_parent ):
+    wxFrame( p_parent, -1, wxU(_("FileInfo")), wxDefaultPosition,
              wxDefaultSize, wxDEFAULT_FRAME_STYLE )
 {
     /* Initializations */
index 483a9bca4865ec06a2a1dcfa84d2e254f3a5fdd8..fba0f13e24f2c2e7d918f6d4030071677dfed056 100644 (file)
@@ -2,7 +2,7 @@
  * interface.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: interface.cpp,v 1.36 2003/05/27 11:35:34 gbazin Exp $
+ * $Id: interface.cpp,v 1.37 2003/06/05 21:22:27 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -171,8 +171,6 @@ Interface::Interface( intf_thread_t *_p_intf ):
     p_prefs_dialog = NULL;
     i_old_playing_status = PAUSE_S;
     p_open_dialog = NULL;
-    p_popup_menu = NULL;
-    b_popup_change = VLC_FALSE;
 
     /* Give our interface a nice little icon */
     p_intf->p_sys->p_icon = new wxIcon( vlc_xpm );
index d2865a2a85e3582b0b50c945c41fccfefd4b4e45..68d62bcad65a8c67257c385a4d74bd805b080f88 100644 (file)
@@ -2,7 +2,7 @@
  * menus.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: menus.cpp,v 1.14 2003/05/26 19:06:47 gbazin Exp $
+ * $Id: menus.cpp,v 1.15 2003/06/05 21:22:28 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
 
 #include <vlc/intf.h>
 
+#if defined MODULE_NAME_IS_skins
+#   include "../skins/src/skin_common.h"
+#endif
+
 #include "wxwindows.h"
 
 class wxMenuItemExt: public wxMenuItem
@@ -92,7 +96,7 @@ BEGIN_EVENT_TABLE(MenuEvtHandler, wxEvtHandler)
     EVT_MENU(-1, MenuEvtHandler::OnMenuEvent)
 END_EVENT_TABLE()
 
-void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface,
+void PopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
                 const wxPoint& pos )
 {
     vlc_object_t *p_object;
@@ -107,7 +111,7 @@ void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface,
     ppsz_varnames[i++] = _("Audio menu");
     ppsz_varnames[i++] = NULL; /* Separator */
 
-    p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_AOUT,
+    p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
                                                 FIND_ANYWHERE );
     if( p_object != NULL )
     {
@@ -123,7 +127,7 @@ void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface,
     ppsz_varnames[i++] = _("Video menu");
     ppsz_varnames[i++] = NULL; /* Separator */
 
-    p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_VOUT,
+    p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
                                                 FIND_ANYWHERE );
     if( p_object != NULL )
     {
@@ -141,7 +145,7 @@ void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface,
     ppsz_varnames[i++] = _("Input menu");
     ppsz_varnames[i++] = NULL; /* Separator */
 
-    p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_INPUT,
+    p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
                                                 FIND_ANYWHERE );
     if( p_object != NULL )
     {
@@ -166,18 +170,18 @@ void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface,
 
     /* Misc stuff */
     ppsz_varnames[i++] = NULL; /* Separator */
-    ppsz_varnames[i++] = _("Close");
+    ppsz_varnames[i++] = _("Close Menu");
 
     /* Build menu */
-    Menu popupmenu( _p_intf, _p_main_interface, i,
+    Menu popupmenu( p_intf, p_parent, i,
                      ppsz_varnames, pi_objects, PopupMenu_Events );
 
-    _p_main_interface->p_popup_menu = &popupmenu;
-    _p_main_interface->PopupMenu( &popupmenu, pos.x, pos.y );
-    _p_main_interface->p_popup_menu = NULL;
+    p_intf->p_sys->p_popup_menu = &popupmenu;
+    p_parent->PopupMenu( &popupmenu, pos.x, pos.y );
+    p_intf->p_sys->p_popup_menu = NULL;
 }
 
-wxMenu *AudioMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
+wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent )
 {
     vlc_object_t *p_object;
     char *ppsz_varnames[5];
@@ -208,11 +212,11 @@ wxMenu *AudioMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
     }
 
     /* Build menu */
-    return new Menu( _p_intf, _p_main_interface, i,
+    return new Menu( _p_intf, p_parent, i,
                      ppsz_varnames, pi_objects, AudioMenu_Events );
 }
 
-wxMenu *VideoMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
+wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent )
 {
     vlc_object_t *p_object;
     char *ppsz_varnames[6];
@@ -247,11 +251,11 @@ wxMenu *VideoMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
     }
 
     /* Build menu */
-    return new Menu( _p_intf, _p_main_interface, i,
+    return new Menu( _p_intf, p_parent, i,
                      ppsz_varnames, pi_objects, VideoMenu_Events );
 }
 
-wxMenu *NavigMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
+wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent )
 {
     vlc_object_t *p_object;
     char *ppsz_varnames[10];
@@ -287,14 +291,14 @@ wxMenu *NavigMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
     }
 
     /* Build menu */
-    return new Menu( _p_intf, _p_main_interface, i,
+    return new Menu( _p_intf, p_parent, i,
                      ppsz_varnames, pi_objects, NavigMenu_Events );
 }
 
 /*****************************************************************************
  * Constructor.
  *****************************************************************************/
-Menu::Menu( intf_thread_t *_p_intf, Interface *_p_main_interface,
+Menu::Menu( intf_thread_t *_p_intf, wxWindow *p_parent,
             int i_count, char **ppsz_varnames, int *pi_objects,
             int i_start_id ): wxMenu( )
 {
@@ -303,7 +307,6 @@ Menu::Menu( intf_thread_t *_p_intf, Interface *_p_main_interface,
 
     /* Initializations */
     p_intf = _p_intf;
-    p_main_interface = _p_main_interface;
 
     i_item_id = i_start_id;
 
@@ -555,7 +558,7 @@ MenuEvtHandler::~MenuEvtHandler()
 
 void MenuEvtHandler::OnMenuEvent( wxCommandEvent& event )
 {
-    wxMenuItem *p_menuitem;
+    wxMenuItem *p_menuitem = NULL;
 
     /* Check if this is an auto generated menu item */
     if( event.GetId() < FirstAutoGenerated_Event )
@@ -564,13 +567,14 @@ void MenuEvtHandler::OnMenuEvent( wxCommandEvent& event )
         return;
     }
 
-    if( (p_menuitem = p_main_interface->GetMenuBar()->FindItem(event.GetId()))
+    if( !p_main_interface ||
+        (p_menuitem = p_main_interface->GetMenuBar()->FindItem(event.GetId()))
         == NULL )
     {
-        if( p_main_interface->p_popup_menu )
+        if( p_intf->p_sys->p_popup_menu )
         {
             p_menuitem = 
-                p_main_interface->p_popup_menu->FindItem( event.GetId() );
+                p_intf->p_sys->p_popup_menu->FindItem( event.GetId() );
         }
     }
 
index 4825e07e490d0db434c68ebf762f624822192963..eef0aa6c6b14f73f81aef122e2a0111a55cc1893 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: messages.cpp,v 1.6 2003/05/12 17:33:19 gbazin Exp $
+ * $Id: messages.cpp,v 1.7 2003/06/05 21:22:28 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *
@@ -75,13 +75,12 @@ END_EVENT_TABLE()
 /*****************************************************************************
  * Constructor.
  *****************************************************************************/
-Messages::Messages( intf_thread_t *_p_intf, Interface *_p_main_interface ):
-    wxFrame( _p_main_interface, -1, wxU(_("Messages")), wxDefaultPosition,
+Messages::Messages( intf_thread_t *_p_intf, wxWindow *p_parent ):
+    wxFrame( p_parent, -1, wxU(_("Messages")), wxDefaultPosition,
              wxDefaultSize, wxDEFAULT_FRAME_STYLE )
 {
     /* Initializations */
     p_intf = _p_intf;
-    p_main_interface = _p_main_interface;
     b_verbose = VLC_FALSE;
     SetIcon( *p_intf->p_sys->p_icon );
 
index b4216a9af872e54366cc6c9182b6ca254b0927dd..49b19baa27a9a8a2a8e2fe95337e635634ac8298 100644 (file)
@@ -2,7 +2,7 @@
  * preferences.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: preferences.cpp,v 1.17 2003/05/26 16:06:13 gbazin Exp $
+ * $Id: preferences.cpp,v 1.18 2003/06/05 21:22:28 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -225,13 +225,12 @@ END_EVENT_TABLE()
 /*****************************************************************************
  * Constructor.
  *****************************************************************************/
-PrefsDialog::PrefsDialog( intf_thread_t *_p_intf, Interface *_p_main_interface)
-  :  wxFrame( _p_main_interface, -1, wxU(_("Preferences")), wxDefaultPosition,
+PrefsDialog::PrefsDialog( intf_thread_t *_p_intf, wxWindow *p_parent)
+  :  wxFrame( p_parent, -1, wxU(_("Preferences")), wxDefaultPosition,
               wxSize(650,450), wxDEFAULT_FRAME_STYLE )
 {
     /* Initializations */
     p_intf = _p_intf;
-    p_main_interface = _p_main_interface;
     SetIcon( *p_intf->p_sys->p_icon );
 
     /* Create a panel to put everything in */
index afc2b0cd14d219478cede173cd04270d5242f7a2..20f8c06ac7b4c69db0b0fbad6240e08f62c37fe8 100644 (file)
@@ -2,7 +2,7 @@
  * timer.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: timer.cpp,v 1.21 2003/06/04 16:03:34 gbazin Exp $
+ * $Id: timer.cpp,v 1.22 2003/06/05 21:22:28 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -69,8 +69,7 @@ Timer::Timer( intf_thread_t *_p_intf, Interface *_p_main_interface )
                                        FIND_ANYWHERE );
     if( p_playlist != NULL )
     {
-        var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB,
-                        p_main_interface );
+        var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
         vlc_object_release( p_playlist );
     }
 
@@ -84,27 +83,6 @@ Timer::~Timer()
 /*****************************************************************************
  * Private methods.
  *****************************************************************************/
-/*****************************************************************************
- * wxModeManage: actualise the aspect of the interface whenever the input
- * changes.
- *****************************************************************************
- * The lock has to be taken before you call the function.
- *****************************************************************************/
-static int wxModeManage( intf_thread_t * p_intf )
-{
-    return 0;
-}
-
-/*****************************************************************************
- * wxSetupMenus: function that generates title/chapter/audio/subpic
- * menus with help from preceding functions
- *****************************************************************************
- * Function called with the lock on stream
- *****************************************************************************/
-static int wxSetupMenus( intf_thread_t * p_intf )
-{
-    return 0;
-}
 
 /*****************************************************************************
  * Manage: manage main thread messages
@@ -119,7 +97,7 @@ void Timer::Notify()
     vlc_mutex_lock( &p_intf->change_lock );
 
     /* If the "display popup" flag has changed */
-    if( p_main_interface->b_popup_change )
+    if( p_intf->p_sys->b_popup_change )
     {
         wxPoint mousepos = wxGetMousePosition();
 
@@ -129,7 +107,7 @@ void Timer::Notify()
 
         p_main_interface->AddPendingEvent(event);
 
-        p_main_interface->b_popup_change = VLC_FALSE;
+        p_intf->p_sys->b_popup_change = VLC_FALSE;
     }
 
     /* Update the log window */
@@ -242,13 +220,6 @@ void Timer::Notify()
                 }
             }
 
-            if( p_intf->p_sys->i_part !=
-                p_input->stream.p_selected_area->i_part )
-            {
-                p_intf->p_sys->b_chapter_update = 1;
-                wxSetupMenus( p_intf );
-            }
-
             /* Manage Playing status */
             if( i_old_playing_status != p_input->stream.control.i_status )
             {
@@ -277,7 +248,6 @@ void Timer::Notify()
     }
     else if( p_intf->p_sys->b_playing && !p_intf->b_die )
     {
-        wxModeManage( p_intf );
         p_intf->p_sys->b_playing = 0;
         p_main_interface->TogglePlayButton( PAUSE_S );
         i_old_playing_status = PAUSE_S;
@@ -325,9 +295,9 @@ void DisplayStreamDate( wxControl *p_slider_frame, intf_thread_t * p_intf ,
 int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
                  vlc_value_t old_val, vlc_value_t new_val, void *param )
 {
-    Interface *p_main_interface = (Interface *)param;
+    intf_thread_t *p_intf = (intf_thread_t *)param;
 
-    p_main_interface->b_popup_change = VLC_TRUE;
+    p_intf->p_sys->b_popup_change = VLC_TRUE;
 
     return VLC_SUCCESS;
 }
index 0516963acb7bab553d43e878d984475b9262828f..5303b49061b8faa66853de2560caee0ccc1b0177 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: wxwindows.cpp,v 1.15 2003/04/17 14:00:44 anil Exp $
+ * $Id: wxwindows.cpp,v 1.16 2003/06/05 21:22:28 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -109,16 +109,14 @@ static int Open( vlc_object_t *p_this )
 
     /* Initialize wxWindows thread */
     p_intf->p_sys->b_playing = 0;
-    p_intf->p_sys->b_popup_changed = 0;
-    p_intf->p_sys->b_window_changed = 0;
-    p_intf->p_sys->b_playlist_changed = 0;
 
     p_intf->p_sys->p_input = NULL;
     p_intf->p_sys->i_playing = -1;
     p_intf->p_sys->b_slider_free = 1;
     p_intf->p_sys->i_slider_pos = p_intf->p_sys->i_slider_oldpos = 0;
 
-    p_intf->p_sys->i_part = 0;
+    p_intf->p_sys->p_popup_menu = NULL;
+    p_intf->p_sys->b_popup_change = VLC_FALSE;
 
     return VLC_SUCCESS;
 }
index cb57a12f0b5b2bd92bc81e64a5489361efdf5406..4c4df1ba97c3dcf57e182597ef9dbefe2bb80bbb 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.h: private wxWindows interface description
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: wxwindows.h,v 1.34 2003/06/03 22:18:58 gbazin Exp $
+ * $Id: wxwindows.h,v 1.35 2003/06/05 21:22:28 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -58,21 +58,6 @@ struct intf_sys_t
 
     /* special actions */
     vlc_bool_t          b_playing;
-    vlc_bool_t          b_popup_changed;                   /* display menu ? */
-    vlc_bool_t          b_window_changed;        /* window display toggled ? */
-    vlc_bool_t          b_playlist_changed;    /* playlist display toggled ? */
-    vlc_bool_t          b_slider_free;                      /* slider status */
-
-    /* menus handlers */
-    vlc_bool_t          b_program_update;   /* do we need to update programs
-                                                                        menu */
-    vlc_bool_t          b_title_update;  /* do we need to update title menus */
-    vlc_bool_t          b_chapter_update;            /* do we need to update
-                                                               chapter menus */
-    vlc_bool_t          b_audio_update;  /* do we need to update audio menus */
-    vlc_bool_t          b_spu_update;      /* do we need to update spu menus */
-
-    /* windows and widgets */
 
     /* The input thread */
     input_thread_t *    p_input;
@@ -80,6 +65,7 @@ struct intf_sys_t
     /* The slider */
     int                 i_slider_pos;                     /* slider position */
     int                 i_slider_oldpos;                /* previous position */
+    vlc_bool_t          b_slider_free;                      /* slider status */
 
     /* The messages window */
     msg_subscription_t* p_sub;                  /* message bank subscription */
@@ -87,8 +73,10 @@ struct intf_sys_t
     /* Playlist management */
     int                 i_playing;                 /* playlist selected item */
 
-    /* The window labels for DVD mode */
-    unsigned int        i_part;                           /* current chapter */
+    /* Popup menu */
+    wxMenu              *p_popup_menu;
+    vlc_bool_t          b_popup_change;
+
 };
 #endif /* !defined(MODULE_NAME_IS_skins) */
 
@@ -139,9 +127,6 @@ public:
      * (and keep the last settings) */
     OpenDialog  *p_open_dialog;
 
-    wxMenu      *p_popup_menu;
-    vlc_bool_t  b_popup_change;
-
 private:
     void CreateOurMenuBar();
     void CreateOurToolBar();
@@ -401,7 +386,7 @@ class PrefsDialog: public wxFrame
 {
 public:
     /* Constructor */
-    PrefsDialog( intf_thread_t *p_intf, Interface *p_main_interface );
+    PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
     virtual ~PrefsDialog();
 
 private:
@@ -416,7 +401,6 @@ private:
     DECLARE_EVENT_TABLE();
 
     intf_thread_t *p_intf;
-    Interface *p_main_interface;
 
     PrefsTreeCtrl *prefs_tree;
 };
@@ -426,7 +410,7 @@ class Messages: public wxFrame
 {
 public:
     /* Constructor */
-    Messages( intf_thread_t *p_intf, Interface *_p_main_interface );
+    Messages( intf_thread_t *p_intf, wxWindow *p_parent );
     virtual ~Messages();
     void UpdateLog();
 
@@ -438,7 +422,6 @@ private:
     DECLARE_EVENT_TABLE();
 
     intf_thread_t *p_intf;
-    Interface *p_main_interface;
     wxTextCtrl *textctrl;
     wxTextAttr *info_attr;
     wxTextAttr *err_attr;
@@ -490,7 +473,7 @@ class FileInfo: public wxFrame
 {
 public:
     /* Constructor */
-    FileInfo( intf_thread_t *p_intf, Interface *p_main_interface );
+    FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
     virtual ~FileInfo();
     void UpdateFileInfo();
 
@@ -522,11 +505,11 @@ private:
 #endif
 
 /* Menus */
-void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface,
+void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
                 const wxPoint& pos );
-wxMenu *AudioMenu( intf_thread_t *_p_intf, Interface *_p_main_interface );
-wxMenu *VideoMenu( intf_thread_t *_p_intf, Interface *_p_main_interface );
-wxMenu *NavigMenu( intf_thread_t *_p_intf, Interface *_p_main_interface );
+wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
+wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
+wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
 
 class MenuEvtHandler : public wxEvtHandler
 {
@@ -548,7 +531,7 @@ class Menu: public wxMenu
 {
 public:
     /* Constructor */
-    Menu( intf_thread_t *p_intf, Interface *p_main_interface, int i_count,
+    Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
           char **ppsz_names, int *pi_objects, int i_start_id );
     virtual ~Menu();
 
@@ -564,7 +547,6 @@ private:
     DECLARE_EVENT_TABLE();
 
     intf_thread_t *p_intf;
-    Interface *p_main_interface;
 
     int  i_item_id;
 };