/*****************************************************************************
* video.cpp : WinCE gui plugin for VLC
*****************************************************************************
- * Copyright (C) 2000-2004, 2003 VideoLAN
+ * Copyright (C) 2000-2004, 2003 the VideoLAN team
* $Id$
*
* Authors: Marodon Cedric <cedric_marodon@yahoo.fr>
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <vlc/vlc.h>
-#include <vlc/vout.h>
-#include <vlc/intf.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_vout.h>
+#include <vlc_interface.h>
#include "wince.h"
{
public:
/* Constructor */
- VideoWindow( intf_thread_t *_p_intf, HINSTANCE _hInst, HWND _p_parent );
+ VideoWindow( intf_thread_t *_p_intf, HWND _p_parent );
virtual ~VideoWindow();
void *GetWindow( vout_thread_t *, int *, int *, unsigned int *,
unsigned int * );
void ReleaseWindow( void * );
int ControlWindow( void *, int, va_list );
-
+
HWND p_child_window; // public because of menu
private:
HWND p_parent;
vlc_mutex_t lock;
- virtual LRESULT WndProc( HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam, PBOOL pbProcessed );
+ virtual LRESULT WndProc( HWND, UINT, WPARAM, LPARAM );
};
/*****************************************************************************
* Public methods.
*****************************************************************************/
-CBaseWindow *CreateVideoWindow( intf_thread_t *p_intf, HINSTANCE hInst,
- HWND p_parent )
+CBaseWindow *CreateVideoWindow( intf_thread_t *p_intf, HWND p_parent )
{
- return new VideoWindow( p_intf, hInst, p_parent );
+ return new VideoWindow( p_intf, p_parent );
}
/*****************************************************************************
* Constructor.
*****************************************************************************/
-VideoWindow::VideoWindow( intf_thread_t *_p_intf, HINSTANCE _hInst,
- HWND _p_parent )
+VideoWindow::VideoWindow( intf_thread_t *_p_intf, HWND _p_parent )
{
RECT rect;
WNDCLASS wc;
p_parent = _p_parent;
p_child_window = NULL;
- vlc_mutex_init( p_intf, &lock );
+ vlc_mutex_init( &lock );
p_vout = NULL;
p_intf->pf_request_window = ::GetWindow;
p_intf->pf_release_window = ::ReleaseWindow;
+ p_intf->pf_control_window = ::ControlWindow;
p_intf->p_sys->p_video_window = this;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hIcon = NULL;
- wc.hInstance = _hInst;
+ wc.hInstance = GetModuleHandle(0);
wc.hCursor = NULL;
wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
wc.lpszMenuName = NULL;
RegisterClass( &wc );
p_child_window = CreateWindow (
- _T("VIDEOWINDOW"), _T(""), WS_CHILD | WS_VISIBLE | WS_BORDER,
+ _T("VIDEOWINDOW"), _T(""),
+ WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | WS_BORDER,
0, 20, rect.right - rect.left,
rect.bottom - rect.top - 2*(MENU_HEIGHT-1) - SLIDER_HEIGHT - 20,
- p_parent, NULL, _hInst, (void *)this );
+ p_parent, NULL, GetModuleHandle(0), (void *)this );
ShowWindow( p_child_window, SW_SHOW );
UpdateWindow( p_child_window );
FUNCTION:
WndProc
-PURPOSE:
+PURPOSE:
Processes messages sent to the main window.
***********************************************************************/
-LRESULT VideoWindow::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
- PBOOL pbProcessed )
+LRESULT VideoWindow::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
{
- LRESULT lResult = CBaseWindow::WndProc( hwnd, msg, wp, lp, pbProcessed );
- BOOL bWasProcessed = *pbProcessed;
- *pbProcessed = TRUE;
-
switch( msg )
{
+ case WM_KILLFOCUS:
+ if( p_vout )
+ vout_Control( p_vout, VOUT_SET_FOCUS, (bool)false );
+ return TRUE;
+
+ case WM_SETFOCUS:
+ if( p_vout )
+ vout_Control( p_vout, VOUT_SET_FOCUS, (bool)true );
+ return TRUE;
+
default:
- // the message was not processed
- // indicate if the base class handled it
- *pbProcessed = bWasProcessed;
- lResult = FALSE;
- return lResult;
+ return DefWindowProc( hwnd, msg, wp, lp );
}
- return lResult;
}
static int ControlWindow( intf_thread_t *p_intf, void *p_window,
switch( i_query )
{
- case VOUT_SET_ZOOM:
- break;
-
case VOUT_SET_STAY_ON_TOP:
break;