]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwindows/wxwindows.cpp
* modules/gui/wxwindows/open.cpp: fixed a couple of bugs with the open dialog.
[vlc] / modules / gui / wxwindows / wxwindows.cpp
index bfab686d797274cf116a393fe60a4eadf658aefe..5303b49061b8faa66853de2560caee0ccc1b0177 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: wxwindows.cpp,v 1.5 2002/11/23 14:28:51 gbazin Exp $
+ * $Id: wxwindows.cpp,v 1.16 2003/06/05 21:22:28 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -10,7 +10,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #include <string.h>                                            /* strerror() */
 #include <stdio.h>
 
-#include <wx/wxprec.h>
-#include <wx/wx.h>
-
-/* Let vlc take care of the i18n stuff */
-#undef _
+#include <vlc/vlc.h>
 
 #ifdef WIN32                                                 /* mingw32 hack */
 #undef Yield
 #undef CreateDialog
 #endif
 
-#include <vlc/vlc.h>
+/* Let vlc take care of the i18n stuff */
+#define WXINTL_NO_GETTEXT_MACRO
+
+#include <wx/wxprec.h>
+#include <wx/wx.h>
+
 #include <vlc/intf.h>
 
 #include "wxwindows.h"
 
+/* Temporary hack */
+#ifdef __DARWIN__
+int wxEntry( int argc, char *argv[] , bool enterLoop = TRUE );
+#endif
+
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
@@ -73,10 +79,12 @@ private:
  * Module descriptor
  *****************************************************************************/
 vlc_module_begin();
-    add_category_hint( N_("wxWindows"), NULL );
     set_description( (char *) _("wxWindows interface module") );
     set_capability( "interface", 50 );
     set_callbacks( Open, Close );
+    add_shortcut( "wxwindows" );
+    add_shortcut( "wxwin" );
+    add_shortcut( "wx" );
     set_program( "wxvlc" );
 vlc_module_end();
 
@@ -101,16 +109,14 @@ static int Open( vlc_object_t *p_this )
 
     /* Initialize wxWindows thread */
     p_intf->p_sys->b_playing = 0;
-    p_intf->p_sys->b_popup_changed = 0;
-    p_intf->p_sys->b_window_changed = 0;
-    p_intf->p_sys->b_playlist_changed = 0;
 
     p_intf->p_sys->p_input = NULL;
     p_intf->p_sys->i_playing = -1;
     p_intf->p_sys->b_slider_free = 1;
     p_intf->p_sys->i_slider_pos = p_intf->p_sys->i_slider_oldpos = 0;
 
-    p_intf->p_sys->i_part = -1;
+    p_intf->p_sys->p_popup_menu = NULL;
+    p_intf->p_sys->b_popup_change = VLC_FALSE;
 
     return VLC_SUCCESS;
 }
@@ -136,15 +142,31 @@ static void Close( vlc_object_t *p_this )
 /*****************************************************************************
  * Run: wxWindows thread
  *****************************************************************************/
+#if !defined(__BUILTIN__) && defined( WIN32 )
+HINSTANCE hInstance = 0;
+extern "C" BOOL WINAPI
+DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
+{
+    hInstance = (HINSTANCE)hModule;
+    return TRUE;
+}
+#endif
+
 static void Run( intf_thread_t *p_intf )
 {
+#if !defined( WIN32 )
     static char  *p_args[] = { "" };
+#endif
 
     /* Hack to pass the p_intf pointer to the new wxWindow Instance object */
     wxTheApp = new Instance( p_intf );
 
 #if defined( WIN32 )
+#if !defined(__BUILTIN__)
+    wxEntry( hInstance/*GetModuleHandle(NULL)*/, NULL, NULL, SW_SHOW, TRUE );
+#else
     wxEntry( GetModuleHandle(NULL), NULL, NULL, SW_SHOW, TRUE );
+#endif
 #else
     wxEntry( 1, p_args );
 #endif
@@ -188,10 +210,16 @@ bool Instance::OnInit()
     /* Create the playlist window */
     p_intf->p_sys->p_playlist_window = new Playlist( p_intf, MainInterface );
 
+    /* Create the log window */
+    p_intf->p_sys->p_messages_window = new Messages( p_intf, MainInterface );
+
+    /* Create the fileinfo window */
+    p_intf->p_sys->p_fileinfo_window = new FileInfo ( p_intf, MainInterface );
+
     /* Show the interface */
-    MainInterface->Show(TRUE);
+    MainInterface->Show( TRUE );
 
-    SetTopWindow(MainInterface);
+    SetTopWindow( MainInterface );
 
     /* Start timer */
     new Timer( p_intf, MainInterface );