/*****************************************************************************
* wince.cpp: WinCE gui plugin for VLC
*****************************************************************************
- * Copyright (C) 2003 VideoLAN
+ * Copyright (C) 2003 the VideoLAN team
* $Id$
*
* Author: Gildas Bazin <gbazin@videolan.org>
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <vlc/vlc.h>
-#include <vlc/intf.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
+#include <vlc_interface.h>
+#include <vlc_input.h>
#if defined( UNDER_CE ) && defined(__MINGW32__)
/* This is a gross hack for the wince gcc cross-compiler */
static int OpenDialogs( vlc_object_t * );
-static void MainLoop ( intf_thread_t * );
+static void* MainLoop ( vlc_object_t * );
static void ShowDialog( intf_thread_t *, int, int, intf_dialog_args_t * );
/*****************************************************************************
"of having it in a separate window.")
vlc_module_begin();
+ set_shortname( "WinCE" );
set_description( (char *) _("WinCE interface module") );
set_capability( "interface", 100 );
set_callbacks( Open, Close );
add_shortcut( "wince" );
- set_program( "wcevlc" );
+ set_category( CAT_INTERFACE );
+ set_subcategory( SUBCAT_INTERFACE_MAIN );
add_bool( "wince-embed", 1, NULL,
- EMBED_TEXT, EMBED_LONGTEXT, VLC_FALSE );
+ EMBED_TEXT, EMBED_LONGTEXT, false );
add_submodule();
- set_description( _("WinCE dialogs provider") );
+ set_description( N_("WinCE dialogs provider") );
set_capability( "dialogs provider", 10 );
set_callbacks( OpenDialogs, Close );
vlc_module_end();
// Check if the application is running.
// If it's running then focus its window and bail out.
- HWND hwndMain = FindWindow( _T("VLC WinCE"), _T("VLC media player") );
+ HWND hwndMain = FindWindow( _T("VLC WinCE"), _T("VLC media player") );
if( hwndMain )
{
SetForegroundWindow( hwndMain );
static void Close( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
+ intf_sys_t *p_sys = p_intf->p_sys;
- if( p_intf->p_sys->p_input )
+ if( p_sys->p_input )
{
- vlc_object_release( p_intf->p_sys->p_input );
+ vlc_object_release( p_sys->p_input );
}
MenuItemExt::ClearList( p_intf->p_sys->p_video_menu );
/* The module is used in dialog provider mode */
/* Create a new thread for the dialogs provider */
- if( vlc_thread_create( p_intf, "Skins Dialogs Thread",
- MainLoop, 0, VLC_TRUE ) )
+ if( vlc_thread_create( p_intf, "WinCE Dialogs Thread",
+ MainLoop, 0, true ) )
{
- msg_Err( p_intf, "cannot create Skins Dialogs Thread" );
+ msg_Err( p_intf, "cannot create WinCE Dialogs Thread" );
p_intf->pf_show_dialog = NULL;
}
}
else
{
+ int canc = vlc_savecancel();
/* The module is used in interface mode */
- MainLoop( p_intf );
+ MainLoop( VLC_OBJECT(p_intf) );
+ vlc_restorecancel( canc );
}
}
-static void MainLoop( intf_thread_t *p_intf )
+static void* MainLoop( vlc_object_t * p_this )
{
+ intf_thread_t *p_intf = (intf_thread_t*)p_this;
MSG msg;
Interface *intf = 0;
+ int canc = vlc_savecancel ();
if( !hInstance ) hInstance = GetModuleHandle(NULL);
/* OK, initialization is over */
vlc_thread_ready( p_intf );
- /* Check if we need to start playing */
- if( !p_intf->pf_show_dialog && p_intf->b_play )
- {
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
- if( p_playlist )
- {
- playlist_Play( p_playlist );
- vlc_object_release( p_playlist );
- }
- }
-
// Main message loop
while( GetMessage( &msg, NULL, 0, 0 ) > 0 )
{
}
end:
- if( intf ) delete intf;
+ delete intf;
#ifndef UNDER_CE
/* Uninitialize OLE/COM */
CoUninitialize();
#endif
+ vlc_restorecancel (canc);
+ return NULL;
}
/*****************************************************************************