]> git.sesse.net Git - vlc/commitdiff
* modules/gui/wince/*: improvements to the WinCE interface.
authorGildas Bazin <gbazin@videolan.org>
Sat, 5 Mar 2005 18:05:42 +0000 (18:05 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sat, 5 Mar 2005 18:05:42 +0000 (18:05 +0000)
modules/gui/wince/interface.cpp
modules/gui/wince/menus.cpp
modules/gui/wince/video.cpp
modules/gui/wince/wince.h

index 4389aca7034a6bde7ce8d20f780adcc7e6f24854..d53a912d85cd9234f5d95bb74a0690158742d910 100644 (file)
@@ -661,29 +661,6 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp,
         RefreshNavigMenu( p_intf,
             (HMENU)SendMessage( hwndCB, SHCMBM_GETSUBMENU, (WPARAM)0,
                                 (LPARAM)IDM_NAVIGATION ) );
-
-#if 0
-        // Undo the video display because menu is opened
-        // due to GAPI, menu top display is not assumed
-        // FIXME verify if p_child_window exits
-        SendMessage( p_intf->p_sys->p_video_window->p_child_window,
-                     WM_INITMENUPOPUP, wp, lp );
-#endif
-
-        //refresh screen
-        /* InvalidateRect(hwnd, NULL, TRUE);
-           /UpdateWindow(hwndCB); //  NULL*/
-        break;
-
-#if 0
-    case WM_NOTIFY:
-        // Redo the video display because menu can be closed
-        // FIXME verify if p_child_window exits
-        if( (((NMHDR *)lp)->code) == NM_CUSTOMDRAW )
-            SendMessage( p_intf->p_sys->p_video_window->p_child_window,
-                         WM_NOTIFY, wp, lp );
-        return lResult;
-#endif
         break;
 
     case WM_LBUTTONDOWN:
@@ -709,6 +686,18 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp,
         DestroyWindow( hwnd );
         break;
 
+    case WM_ENTERMENULOOP:
+    case WM_KILLFOCUS:
+        if( video && video->hWnd )
+            SendMessage( video->hWnd, WM_KILLFOCUS, 0, 0 );
+        break;
+
+    case WM_EXITMENULOOP:
+    case WM_SETFOCUS:
+        if( video && video->hWnd )
+            SendMessage( video->hWnd, WM_SETFOCUS, 0, 0 );
+        break;
+
     case WM_DESTROY:
         PostQuitMessage( 0 );
         break;
index c1ec2bb1148a2a3344b583d70e0f427b627f348e..1a20607bea5635adb3cfe1d3800b552a76638602 100644 (file)
@@ -88,6 +88,11 @@ void PopupMenu( intf_thread_t *p_intf, HWND p_parent, POINT point )
     /* Initializations */
     memset( pi_objects, 0, MAX_POPUP_ITEMS * sizeof(int) );
 
+    ppsz_varnames[i] = "VLC media player";
+    pi_objects[i++] = 0;
+    ppsz_varnames[i++] = NULL; /* Separator */
+    i_last_separator = i;
+
     /* Input menu */
     p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
                                                 FIND_ANYWHERE );
@@ -302,7 +307,7 @@ void RefreshVideoMenu( intf_thread_t *p_intf, HMENU hMenu )
     /* Delete old menu */
     int count = wce_GetMenuItemCount( hMenu );
     for( i = 0; i <= count; i++ ) RemoveMenu( hMenu, 0, MF_BYPOSITION );
-        
+
     if( p_intf->p_sys->p_video_menu )
     {
         for( iter = p_intf->p_sys->p_video_menu->begin();
@@ -311,7 +316,7 @@ void RefreshVideoMenu( intf_thread_t *p_intf, HMENU hMenu )
         p_intf->p_sys->p_video_menu->clear();
     }
     else p_intf->p_sys->p_video_menu = new vector<MenuItemExt*>;
-        
+
     /* Initializations */
     memset( pi_objects, 0, MAX_VIDEO_ITEMS * sizeof(int) );
     i = 0;
index d4dcbd000c863a81a959ebd7d262e289f625f4fd..0a39e5646c8ba264e753b9a0919800082f9b6d0e 100644 (file)
@@ -98,6 +98,7 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, HWND _p_parent )
 
     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;
 
@@ -116,7 +117,8 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, HWND _p_parent )
     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, GetModuleHandle(0), (void *)this );
@@ -192,7 +194,24 @@ PURPOSE:
 ***********************************************************************/
 LRESULT VideoWindow::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
 {
-    return DefWindowProc( hwnd, msg, wp, lp );
+    switch( msg )
+    {
+    case WM_KILLFOCUS:
+        msg_Err( p_intf, "WM_KILLFOCUS1" );
+        if( p_vout )
+            vout_Control( p_vout, VOUT_SET_FOCUS, (vlc_bool_t)VLC_FALSE );
+        return TRUE;
+
+    case WM_SETFOCUS:
+        msg_Err( p_intf, "WM_SETFOCUS1" );
+        if( p_vout )
+            vout_Control( p_vout, VOUT_SET_FOCUS, (vlc_bool_t)VLC_TRUE );
+        return TRUE;
+
+    default:
+        return DefWindowProc( hwnd, msg, wp, lp );
+    }
+
 }
 
 static int ControlWindow( intf_thread_t *p_intf, void *p_window,
index 17a290345ff06c49f003ef3fc9ecbe64b2040e35..2e54cfd9a62cdc5d1a5ff7548b8c4e84e2f30747 100644 (file)
@@ -100,7 +100,7 @@ struct intf_sys_t
 class CBaseWindow
 {
 public:
-    CBaseWindow(){ hInst = 0; }
+    CBaseWindow() : hWnd(0), hInst(0) {};
     virtual ~CBaseWindow() {};
 
     HWND hWnd;                // The main window handle
@@ -158,7 +158,6 @@ public:
     Timer *ti;
     OpenDialog *open;
     CBaseWindow *video;
-    HWND hwndVideo;
 
 protected: