modules/gui/wxwindows/preferences.cpp \
modules/gui/wxwindows/streamout.cpp \
modules/gui/wxwindows/subtitles.cpp \
+ modules/gui/wxwindows/menus.cpp \
$(NULL)
SOURCES_basic_skins = \
* 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
#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
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
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
\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
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
{\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
* 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
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
* 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>
class Theme;
class Dialogs;
+class wxMenu;
class wxIcon;
#ifdef X11_SKINS
// 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
* 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>
if(len != BLOCKSIZE)
{
fprintf(stderr, "gzread: incomplete block read");
- return -1;
+ //return -1;
}
/*
* 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>
*
/*****************************************************************************
* 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 */
* 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>
*
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 );
* 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
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;
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 )
{
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 )
{
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 )
{
/* 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];
}
/* 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];
}
/* 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];
}
/* 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( )
{
/* Initializations */
p_intf = _p_intf;
- p_main_interface = _p_main_interface;
i_item_id = i_start_id;
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 )
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() );
}
}
* 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>
*
/*****************************************************************************
* 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 );
* 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>
*
/*****************************************************************************
* 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 */
* 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>
*
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 );
}
/*****************************************************************************
* 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
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();
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 */
}
}
- 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 )
{
}
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;
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;
}
* 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>
*
/* 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;
}
* 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>
*
/* 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;
/* 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 */
/* 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) */
* (and keep the last settings) */
OpenDialog *p_open_dialog;
- wxMenu *p_popup_menu;
- vlc_bool_t b_popup_change;
-
private:
void CreateOurMenuBar();
void CreateOurToolBar();
{
public:
/* Constructor */
- PrefsDialog( intf_thread_t *p_intf, Interface *p_main_interface );
+ PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
virtual ~PrefsDialog();
private:
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
- Interface *p_main_interface;
PrefsTreeCtrl *prefs_tree;
};
{
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();
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
- Interface *p_main_interface;
wxTextCtrl *textctrl;
wxTextAttr *info_attr;
wxTextAttr *err_attr;
{
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();
#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
{
{
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();
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
- Interface *p_main_interface;
int i_item_id;
};