]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins/src/skin_main.cpp
* modules/gui/wxwindows/*: The wxwindows interface is now a "dialogs provider" module...
[vlc] / modules / gui / skins / src / skin_main.cpp
index c18235c8f6d6660a6a958418109e35fa3f69d01a..b18965b3070ffefd0736a3b1c4118ec46f712f6b 100644 (file)
@@ -2,7 +2,7 @@
  * skin-main.cpp: skins plugin for VLC
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: skin_main.cpp,v 1.41 2003/06/22 17:52:12 gbazin Exp $
+ * $Id: skin_main.cpp,v 1.45 2003/07/17 17:30:40 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
 #include <vlc/intf.h>
 #include <vlc/aout.h>
 
-//--- GENERAL ---------------------------------------------------------------
-#if !defined(MODULE_NAME_IS_basic_skins)
-#ifdef WIN32                                               /* mingw32 hack */
-#   undef Yield
-#   undef CreateDialog
-#endif
-/* Let vlc take care of the i18n stuff */
-#define WXINTL_NO_GETTEXT_MACRO
-#include <wx/wx.h>
-#endif
-
 //--- SKIN ------------------------------------------------------------------
 #include "../os_api.h"
 #include "event.h"
 #include "skin_common.h"
 #include "dialogs.h"
 
-#if !defined(MODULE_NAME_IS_basic_skins)
-#include "../../wxwindows/wxwindows.h"
-#endif
-
 #ifdef X11_SKINS
 #include <X11/Xlib.h>
 #include <Imlib2.h>
@@ -102,6 +87,7 @@ static int Open ( vlc_object_t *p_this )
     };
 
     p_intf->pf_run = Run;
+    p_intf->p_sys->pf_showdialog = Dialogs::ShowDialog;
 
 
     // Suscribe to messages bank
@@ -120,15 +106,7 @@ static int Open ( vlc_object_t *p_this )
     p_intf->p_sys->p_playlist = (playlist_t *)vlc_object_find( p_intf,
         VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
 
-#ifdef GTK2_SKINS
-    // Initialize GDK
-    int    i_args   = 3;
-    char  *p_args[] = { "", "", "--sync", NULL };
-    char **pp_args  = p_args;
-
-    gdk_init( &i_args, &pp_args );
-
-#elif defined X11_SKINS
+#if defined X11_SKINS
     // Initialize X11
     Display *display = XOpenDisplay( NULL );
     p_intf->p_sys->display = display;
@@ -257,12 +235,9 @@ static void Run( intf_thread_t *p_intf )
 
     int a = OSAPI_GetTime();
 
-#if !defined(MODULE_NAME_IS_basic_skins)
     // Initialize the dialog boxes
     p_intf->p_sys->p_dialogs = new Dialogs( p_intf );
-    if( !p_intf->p_sys->p_dialogs ||
-        !p_intf->p_sys->p_dialogs->OpenDlg ) return;
-#endif
+    if( !p_intf->p_sys->p_dialogs ) return;
 
     // Load a theme
     char *skin_last = config_GetPsz( p_intf, "skin_last" );
@@ -294,6 +269,7 @@ static void Run( intf_thread_t *p_intf )
         if( !Loader->Load( user_skin ) && !Loader->Load( default_skin ) )
         {
 #endif
+#if 0
 #if !defined(MODULE_NAME_IS_basic_skins)
             wxMutexGuiEnter();
             wxFileDialog dialog( NULL,
@@ -314,11 +290,14 @@ static void Run( intf_thread_t *p_intf )
                 wxMutexGuiLeave();
             }
             else
+#endif
 #endif
             {
                 delete Loader;
+#if 0
 #if !defined(MODULE_NAME_IS_basic_skins)
                 wxMutexGuiLeave();
+#endif
 #endif
                 return;
             }
@@ -333,15 +312,12 @@ static void Run( intf_thread_t *p_intf )
 
     msg_Dbg( p_intf, "Load theme time : %i ms", OSAPI_GetTime() - a );
 
-    // Refresh the whole interface
     OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (int)true );
 
     OSRun( p_intf );
 
-#if !defined(MODULE_NAME_IS_basic_skins)
     // clean up the dialog boxes
     delete p_intf->p_sys->p_dialogs;
-#endif
 }
 
 //---------------------------------------------------------------------------
@@ -390,16 +366,6 @@ int SkinManage( intf_thread_t *p_intf )
         p_intf->p_sys->p_input = NULL;
     }
 
-    OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (long)false );
-
-#if !defined(MODULE_NAME_IS_basic_skins) //FIXME
-    // Update the log window
-    p_intf->p_sys->p_dialogs->MessagesDlg->UpdateLog();
-
-    // Update the file info window
-    p_intf->p_sys->p_dialogs->FileInfoDlg->UpdateFileInfo();
-#endif
-
     //-------------------------------------------------------------------------
     if( p_intf->p_sys->p_input != NULL && !p_intf->p_sys->p_input->b_die )
     {
@@ -419,7 +385,6 @@ int SkinManage( intf_thread_t *p_intf )
             p_intf->p_sys->p_theme->EvtBank->Get( "volume_refresh" ),
             (long)( volume * SLIDER_RANGE / AOUT_VOLUME_MAX ) );
 
-
         // Refresh slider
         // if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )
         if( p_input->stream.b_seekable )