Commit dcedffea authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wince: misc small fixes.

parent 597f9cf7
......@@ -115,15 +115,6 @@ BOOL Interface::InitInstance( HINSTANCE hInstance, intf_thread_t *_p_intf )
hInst = hInstance; // Store instance handle in our global variable
// Check if the application is running.
// If it's running then focus its window.
hwndMain = FindWindow( _T("VLC WinCE"), _T("VLC media player") );
if( hwndMain )
{
SetForegroundWindow( hwndMain );
return TRUE;
}
// Register window class
WNDCLASS wc;
wc.style = CS_HREDRAW | CS_VREDRAW ;
......
......@@ -59,7 +59,7 @@ public:
unsigned int * );
void ReleaseWindow( void * );
int ControlWindow( void *, int, va_list );
HWND p_child_window; // public because of menu
private:
......@@ -69,14 +69,14 @@ private:
vlc_mutex_t lock;
virtual LRESULT WndProc( HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam, PBOOL pbProcessed );
WPARAM wParam, LPARAM lParam, PBOOL pbProcessed );
};
/*****************************************************************************
* Public methods.
*****************************************************************************/
CBaseWindow *CreateVideoWindow( intf_thread_t *p_intf, HINSTANCE hInst,
HWND p_parent )
HWND p_parent )
{
return new VideoWindow( p_intf, hInst, p_parent );
}
......@@ -124,7 +124,7 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, HINSTANCE _hInst,
rect.bottom - rect.top - 2*(MENU_HEIGHT-1) - SLIDER_HEIGHT - 20,
p_parent, NULL, _hInst, (void *)this );
// ShowWindow( p_child_window, 1 );
ShowWindow( p_child_window, SW_SHOW );
UpdateWindow( p_child_window );
ReleaseWindow( (void*)p_child_window );
......@@ -165,6 +165,7 @@ void *VideoWindow::GetWindow( vout_thread_t *_p_vout,
vlc_mutex_unlock( &lock );
ShowWindow( (HWND)p_child_window, SW_SHOW );
return p_child_window;
}
......@@ -176,11 +177,11 @@ static void ReleaseWindow( intf_thread_t *p_intf, void *p_window )
void VideoWindow::ReleaseWindow( void *p_window )
{
vlc_mutex_lock( &lock );
p_vout = NULL;
ShowWindow( (HWND)p_window, SW_HIDE );
vlc_mutex_unlock( &lock );
ShowWindow( (HWND)p_window, SW_HIDE );
SetForegroundWindow( p_parent );
}
/***********************************************************************
......
......@@ -30,10 +30,7 @@
#if defined( UNDER_CE ) && defined(__MINGW32__)
/* This is a gross hack for the wince gcc cross-compiler */
#undef strerror
#define _off_t long
char *strerror( int i_err ){ return "error message not available"; };
void abort (void){};
#endif
#include "wince.h"
......@@ -77,10 +74,19 @@ DllMain( HANDLE hModule, DWORD fdwReason, LPVOID lpReserved )
/*****************************************************************************
* Open: initialize interface
*****************************************************************************/
static int Open ( vlc_object_t *p_this )
static int Open( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
// 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") );
if( hwndMain )
{
SetForegroundWindow( hwndMain );
return VLC_EGENERIC;
}
// Allocate instance and initialize some members
p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
......@@ -112,7 +118,7 @@ static int Open ( vlc_object_t *p_this )
/*****************************************************************************
* Close: destroy interface
*****************************************************************************/
static void Close ( vlc_object_t *p_this )
static void Close( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment