* skin-main.cpp: skins plugin for VLC
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: skin_main.cpp,v 1.29 2003/06/01 16:39:49 asmax Exp $
+ * $Id: skin_main.cpp,v 1.33 2003/06/06 23:34:35 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#include "themeloader.h"
#include "vlcproc.h"
#include "skin_common.h"
+#include "dialogs.h"
+
#ifndef BASIC_SKINS
#include "../../wxwindows/wxwindows.h"
#endif
#elif defined X11_SKINS
// Initialize X11
p_intf->p_sys->display = XOpenDisplay( NULL );
+ vlc_mutex_init( p_intf, &p_intf->p_sys->xlock );
#elif defined WIN32
+ // Interface thread id used to post broadcast messages
+ p_intf->p_sys->dwThreadId = GetCurrentThreadId();
+
// We dynamically load msimg32.dll to get a pointer to TransparentBlt()
p_intf->p_sys->h_msimg32_dll = LoadLibrary("msimg32.dll");
if( !p_intf->p_sys->h_msimg32_dll ||
FreeLibrary( p_intf->p_sys->h_msimg32_dll );
if( p_intf->p_sys->h_user32_dll )
FreeLibrary( p_intf->p_sys->h_user32_dll );
+#elif defined X11_SKINS
+ vlc_mutex_destroy( &p_intf->p_sys->xlock );
#endif
// Destroy structure
int a = OSAPI_GetTime();
+#ifndef BASIC_SKINS
+ // Initialize the dialog boxes
+ p_intf->p_sys->p_dialogs = new Dialogs( p_intf );
+ if( !p_intf->p_sys->p_dialogs ||
+ !p_intf->p_sys->p_dialogs->OpenDlg ) return;
+#endif
+
// Load a theme
char *skin_last = config_GetPsz( p_intf, "skin_last" );
ThemeLoader *Loader = new ThemeLoader( p_intf );
#endif
{
// Last chance: the user can select a new theme file
-// FIXME: wxWindows isn't initialized yet !!!
-#if 0
#ifndef BASIC_SKINS
- wxFileDialog dialog( NULL, _("Open a skin file"), "", "",
- "Skin files (*.vlt)|*.vlt|Skin files (*.xml)|*.xml|"
- "All files|*.*", wxOPEN );
+ wxFileDialog dialog( NULL,
+ wxU(_("Open a skin file")), wxT(""), wxT(""),
+ wxT("Skin files (*.vlt)|*.vlt|Skin files (*.xml)|*.xml|"
+ "All files|*.*"), wxOPEN );
if( dialog.ShowModal() == wxID_OK )
{
// try to load selected file
- if( ! Loader->Load( dialog.GetPath().c_str() ) )
+ if( ! Loader->Load( (string)dialog.GetPath().mb_str() ) )
{
// He, he, what the hell is he doing ?
delete Loader;
}
}
else
-#endif
#endif
{
delete Loader;
delete Loader;
- msg_Err( p_intf, "Load theme time : %i ms", OSAPI_GetTime() - a );
+ msg_Dbg( p_intf, "Load theme time : %i ms", OSAPI_GetTime() - a );
// Refresh the whole interface
OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (int)true );
OSRun( p_intf );
+
+#ifndef BASIC_SKINS
+ // clean up the dialog boxes
+ delete p_intf->p_sys->p_dialogs;
+#endif
}
//---------------------------------------------------------------------------
OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (long)false );
-#ifndef BASIC_SKINS
+#ifndef BASIC_SKINS //FIXME
// Update the log window
- p_intf->p_sys->MessagesDlg->UpdateLog();
+ p_intf->p_sys->p_dialogs->MessagesDlg->UpdateLog();
// Update the file info window
- p_intf->p_sys->InfoDlg->UpdateFileInfo();
+ p_intf->p_sys->p_dialogs->FileInfoDlg->UpdateFileInfo();
#endif
//-------------------------------------------------------------------------