]> git.sesse.net Git - vlc/blobdiff - modules/gui/wince/video.cpp
input: Expose input_ItemHasErrorWhenReading.
[vlc] / modules / gui / wince / video.cpp
index abff2383cb8fbc75bab8efa7df4e03e16c43bd87..6e307bae3ce777830b37fb58989f9ef7a15f0007 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * 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"
 
@@ -52,14 +56,14 @@ class VideoWindow : public CBaseWindow
 {
 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:
@@ -68,24 +72,21 @@ 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;
@@ -95,12 +96,13 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, HINSTANCE _hInst,
     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;
 
@@ -111,7 +113,7 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, HINSTANCE _hInst,
     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;
@@ -119,10 +121,11 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, HINSTANCE _hInst,
     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 );
@@ -189,28 +192,28 @@ void VideoWindow::ReleaseWindow( void *p_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,
@@ -228,9 +231,6 @@ int VideoWindow::ControlWindow( void *p_window, int i_query, va_list args )
 
     switch( i_query )
     {
-    case VOUT_SET_ZOOM:
-        break;
-
     case VOUT_SET_STAY_ON_TOP:
         break;