* vlcproc.cpp: VlcProc class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.cpp,v 1.25 2003/05/24 17:52:48 gbazin Exp $
+ * $Id: vlcproc.cpp,v 1.26 2003/05/29 16:48:29 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
void VlcProc::OpenFile( bool play )
{
#ifndef BASIC_SKINS
- if( p_intf->p_sys->OpenDlg->ShowModal() != wxID_OK )
+ int iRc;
+
+ // FIXME: just for testing
+ wxMutexGuiEnter();
+ iRc = p_intf->p_sys->OpenDlg->ShowModal();
+ wxMutexGuiLeave();
+ if( iRc != wxID_OK )
{
return;
}
if( play )
{
+ wxMutexGuiEnter();
// Append and play
for( size_t i = 0; i < p_intf->p_sys->OpenDlg->mrl.GetCount(); i++ )
{
(const char *)p_intf->p_sys->OpenDlg->mrl[i].mb_str(),
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), PLAYLIST_END );
}
+ wxMutexGuiLeave();
p_intf->p_sys->p_theme->EvtBank->Get( "play" )->SendEvent();
}
else
{
+ wxMutexGuiEnter();
// Append only
for( size_t i = 0; i < p_intf->p_sys->OpenDlg->mrl.GetCount(); i++ )
{
(const char *)p_intf->p_sys->OpenDlg->mrl[i].mb_str(),
PLAYLIST_APPEND, PLAYLIST_END );
}
+ wxMutexGuiLeave();
}
// Refresh interface !
* x11_run.cpp:
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: x11_run.cpp,v 1.10 2003/05/28 23:56:51 asmax Exp $
+ * $Id: x11_run.cpp,v 1.11 2003/05/29 16:48:29 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
// include the icon graphic
#include "share/vlc32x32.xpm"
-#include <unistd.h>
-
-
//---------------------------------------------------------------------------
// Specific method
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// X11 event processing
//---------------------------------------------------------------------------
-void ProcessEvent( intf_thread_t *p_intf, VlcProc *proc, XEvent *event )
+int ProcessEvent( intf_thread_t *p_intf, VlcProc *proc, XEvent *event )
{
// Variables
list<SkinWindow *>::const_iterator win;
#ifndef BASIC_SKINS
wxExit();
#endif
- return; // Exit VLC !
+ return 1; // Exit VLC !
}
}
else
if( (*win)->ProcessEvent( evt ) )
{
delete (OSEvent *)evt;
- return;
+ return 0;
}
else
{
// Check if vlc is closing
proc->IsClosing();
-
+
+ return 0;
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void OSRun( intf_thread_t *p_intf )
{
- static char *p_args[] = { "" };
-
VlcProc *proc = new VlcProc( p_intf );
+ Display *display = ((OSTheme *)p_intf->p_sys->p_theme)->GetDisplay();
+
#ifndef BASIC_SKINS
// Create a new thread for wxWindows
if( vlc_thread_create( p_intf, "Skins Dialogs Thread", SkinsDialogsThread,
return;
}
#endif
-
- Display *display = ((OSTheme *)p_intf->p_sys->p_theme)->GetDisplay();
// Main event loop
+ int close = 0;
int count = 0;
- while( 1 )
+ while( !close )
{
XEvent event;
- while( XPending( display ) > 0 )
+ while( !close && XPending( display ) > 0 )
{
XNextEvent( display, &event );
- ProcessEvent( p_intf, proc, &event );
+ close = ProcessEvent( p_intf, proc, &event );
}
- usleep( 1000 );
+
+ msleep( 1000 );
if( ++count == 100 )
{
count = 0;
* x11_theme.cpp: X11 implementation of the Theme class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: x11_theme.cpp,v 1.5 2003/05/28 23:56:51 asmax Exp $
+ * $Id: x11_theme.cpp,v 1.6 2003/05/29 16:48:29 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
// Create the window
Window root = DefaultRootWindow( display );
XSetWindowAttributes attr;
- attr.override_redirect = True;
Window wnd = XCreateWindow( display, root, 0, 0, 1, 1, 0, 0, InputOutput,
- CopyFromParent, CWOverrideRedirect, &attr );
+ CopyFromParent, 0, &attr );
XSelectInput( display, wnd, ExposureMask|StructureNotifyMask|
KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask|
PointerMotionMask|EnterWindowMask|LeaveWindowMask);
XNextEvent( display, &evt );
} while( evt.type != MapNotify );
- fprintf(stderr, "\nDONE\n");
-
WindowList.push_back( (SkinWindow *)new OSWindow( p_intf, wnd, x, y,
visible, fadetime, alpha, movealpha, dragdrop, name ) ) ;
}