]> git.sesse.net Git - vlc/blobdiff - modules/gui/wince/wince.cpp
Qt4 - make GNOME and KDE people happy.
[vlc] / modules / gui / wince / wince.cpp
index 3985211d78337c066c1ea7c2bec91cb638bb52b6..7a223138574069a09922a03219a063f80b2efc40 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * wince.cpp: WinCE gui plugin for VLC
  *****************************************************************************
- * Copyright (C) 2003 VideoLAN
+ * Copyright (C) 2003 the VideoLAN team
  * $Id$
  *
  * Author: Gildas Bazin <gbazin@videolan.org>
@@ -26,7 +26,7 @@
  * Preamble
  *****************************************************************************/
 #include <vlc/vlc.h>
-#include <vlc/intf.h>
+#include <vlc_interface.h>
 
 #if defined( UNDER_CE ) && defined(__MINGW32__)
 /* This is a gross hack for the wince gcc cross-compiler */
@@ -96,7 +96,7 @@ static int Open( vlc_object_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") );  
+    HWND hwndMain = FindWindow( _T("VLC WinCE"), _T("VLC media player") );
     if( hwndMain )
     {
         SetForegroundWindow( hwndMain );
@@ -112,7 +112,7 @@ static int Open( vlc_object_t *p_this )
     }
 
     // Suscribe to messages bank
-    p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
+    p_intf->p_sys->p_sub = msg_Subscribe( p_intf, MSG_QUEUE_NORMAL );
 
     // Misc init
     p_intf->p_sys->p_audio_menu = NULL;
@@ -207,9 +207,8 @@ static void Run( intf_thread_t *p_intf )
 static void MainLoop( intf_thread_t *p_intf )
 {
     MSG msg;
-    Interface intf;
+    Interface *intf = 0;
 
-    p_intf->p_sys->p_main_window = &intf;
     if( !hInstance ) hInstance = GetModuleHandle(NULL);
 
     // Register window class
@@ -234,17 +233,10 @@ static void MainLoop( intf_thread_t *p_intf )
     if( !p_intf->pf_show_dialog )
     {
         /* The module is used in interface mode */
-        p_intf->p_sys->p_window = &intf;
+        p_intf->p_sys->p_window = intf = new Interface( p_intf, 0, hInstance );
 
         /* Create/Show the interface */
-        if( !intf.InitInstance( hInstance, p_intf ) )
-        {
-#ifndef UNDER_CE
-            /* Uninitialize OLE/COM */
-            CoUninitialize();
-#endif
-            return;
-        }
+        if( !intf->InitInstance() ) goto end;
     }
 
     /* Creates the dialogs provider */
@@ -277,6 +269,9 @@ static void MainLoop( intf_thread_t *p_intf )
         DispatchMessage( &msg );
     }
 
+ end:
+    if( intf ) delete intf;
+
 #ifndef UNDER_CE
     /* Uninitialize OLE/COM */
     CoUninitialize();