]> git.sesse.net Git - vlc/commitdiff
* configure.ac.in: bail out with an error message if the x11 skins are enabled and...
authorGildas Bazin <gbazin@videolan.org>
Tue, 3 Jun 2003 22:18:58 +0000 (22:18 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 3 Jun 2003 22:18:58 +0000 (22:18 +0000)
* modules/gui/wxwindows/*: fixed bug in sout dialog box.
* modules/gui/skins/*: factorised the wxwindows dialogs code in dialogs.cpp. wxWindows is also initialised earlier on to allow opening a skins file with a wxWin dialog box. (Note: I badly broke the GTK2 skins).

configure.ac.in
modules/gui/skins/Modules.am
modules/gui/skins/gtk2/gtk2_run.cpp
modules/gui/skins/src/skin_common.h
modules/gui/skins/src/skin_main.cpp
modules/gui/skins/src/vlcproc.cpp
modules/gui/skins/src/vlcproc.h
modules/gui/skins/win32/win32_run.cpp
modules/gui/skins/x11/x11_run.cpp
modules/gui/wxwindows/streamout.cpp
modules/gui/wxwindows/wxwindows.h

index 2ab1e8d06e8656374a6438f8ab989ff38d7f6afc..9d204cf6a7995258a5a15a2e7562215d3441fd86 100644 (file)
@@ -2440,8 +2440,13 @@ if test "x${enable_skins}" != "xno"; then
         CPPFLAGS_skins="${CPPFLAGS_skins} -O2 -fno-rtti -Imodules/gui/skins ${GTK2_CFLAGS} -DGTK2_SKINS"
         LDFLAGS_skins="${LDFLAGS_skins} -lstdc++  ${GTK2_LIBS}"
       else
+
        IMLIB2_PATH="${PATH}"
         AC_PATH_PROG(IMLIB2_CONFIG_SKINS, imlib2-config, no, ${IMLIB2_PATH})
+        if test "x${IMLIB2_CONFIG_SKINS}" = "xno"; then
+          AC_MSG_ERROR([Couldn't find the imlib2 package. You can download imlib2 from http://enlightenment.org/, or configure with --disable-skins.])
+        fi
+
         PLUGINS="${PLUGINS} skins"
         CPPFLAGS_skins="${CPPFLAGS_skins} -O2 -fno-rtti -Imodules/gui/skins -I${x_includes} `${IMLIB2_CONFIG_SKINS} --cflags` -DX11_SKINS"
         LDFLAGS_skins="${LDFLAGS_skins} -lstdc++ -L${x_libraries} -lXext -lX11 `${IMLIB2_CONFIG_SKINS} --libs`"
@@ -2473,8 +2478,13 @@ if test "x${enable_basic_skins}" = "xyes"; then
       CPPFLAGS_basic_skins="${CPPFLAGS_basic_skins} -O2 -fno-rtti -Imodules/gui/skins ${GTK2_CFLAGS} -DGTK2_SKINS"
       LDFLAGS_basic_skins="${LDFLAGS_basic_skins} -lstdc++  ${GTK2_LIBS}"
     else
+
       IMLIB2_PATH="${PATH}"
       AC_PATH_PROG(IMLIB2_CONFIG_SKINS, imlib2-config, no, ${IMLIB2_PATH})
+      if test "x${IMLIB2_CONFIG_SKINS}" = "xno"; then
+      AC_MSG_ERROR([Couldn't find the imlib2 package. You can download imlib2 from http://enlightenment.org/, or configure with --disable-basic-skins.])
+      fi
+
       CPPFLAGS_basic_skins="${CPPFLAGS_basic_skins} -O2 -fno-rtti -Imodules/gui/skins -I${x_includes} `${IMLIB2_CONFIG_SKINS} --cflags` -DX11_SKINS"
       LDFLAGS_basic_skins="${LDFLAGS_basic_skins} -lstdc++ -L${x_libraries} -lXext -lX11 `${IMLIB2_CONFIG_SKINS} --libs`"
     fi
index 1c23c8628ce3669313eeba58201517face497a3f..c93932c1a1e7d8bd1e5d26d7152d12b275ec82bc 100644 (file)
@@ -1,4 +1,4 @@
-SOURCES_skins = \
+COMMON_skins = \
        modules/gui/skins/os_api.h \
        modules/gui/skins/os_bitmap.h \
        modules/gui/skins/os_event.h \
@@ -39,6 +39,8 @@ SOURCES_skins = \
        modules/gui/skins/src/bezier.h \
        modules/gui/skins/src/bitmap.cpp \
        modules/gui/skins/src/bitmap.h \
+       modules/gui/skins/src/dialogs.cpp \
+       modules/gui/skins/src/dialogs.h \
        modules/gui/skins/src/event.cpp \
        modules/gui/skins/src/event.h \
        modules/gui/skins/src/font.cpp \
@@ -105,8 +107,10 @@ SOURCES_skins = \
        modules/gui/skins/x11/x11_theme.cpp \
        modules/gui/skins/x11/x11_theme.h \
        modules/gui/skins/x11/x11_window.cpp \
-       modules/gui/skins/x11/x11_window.h \
-       \
+       modules/gui/skins/x11/x11_window.h
+
+SOURCES_skins = \
+       $(COMMON_skins) \
        modules/gui/wxwindows/wxwindows.h \
        modules/gui/wxwindows/fileinfo.cpp \
        modules/gui/wxwindows/messages.cpp \
@@ -117,113 +121,7 @@ SOURCES_skins = \
        $(NULL)
 
 SOURCES_basic_skins = \
-       modules/gui/skins/os_api.h \
-       modules/gui/skins/os_bitmap.h \
-       modules/gui/skins/os_event.h \
-       modules/gui/skins/os_font.h \
-       modules/gui/skins/os_graphics.h \
-       modules/gui/skins/os_theme.h \
-       modules/gui/skins/os_window.h \
-       \
-       modules/gui/skins/controls/controls.h \
-       modules/gui/skins/controls/button.cpp \
-       modules/gui/skins/controls/button.h \
-       modules/gui/skins/controls/checkbox.cpp \
-       modules/gui/skins/controls/checkbox.h \
-       modules/gui/skins/controls/generic.cpp \
-       modules/gui/skins/controls/generic.h \
-       modules/gui/skins/controls/image.cpp \
-       modules/gui/skins/controls/image.h \
-       modules/gui/skins/controls/playlist.cpp \
-       modules/gui/skins/controls/playlist.h \
-       modules/gui/skins/controls/rectangle.cpp \
-       modules/gui/skins/controls/rectangle.h \
-       modules/gui/skins/controls/slider.cpp \
-       modules/gui/skins/controls/slider.h \
-       modules/gui/skins/controls/text.cpp \
-       modules/gui/skins/controls/text.h \
-       \
-       modules/gui/skins/parser/flex.c \
-       modules/gui/skins/parser/skin.h \
-       modules/gui/skins/parser/skin.c \
-       modules/gui/skins/parser/wrappers.h \
-       modules/gui/skins/parser/wrappers.cpp \
-       \
-       modules/gui/skins/src/anchor.cpp \
-       modules/gui/skins/src/anchor.h \
-       modules/gui/skins/src/banks.cpp \
-       modules/gui/skins/src/banks.h \
-       modules/gui/skins/src/bezier.cpp \
-       modules/gui/skins/src/bezier.h \
-       modules/gui/skins/src/bitmap.cpp \
-       modules/gui/skins/src/bitmap.h \
-       modules/gui/skins/src/event.cpp \
-       modules/gui/skins/src/event.h \
-       modules/gui/skins/src/font.cpp \
-       modules/gui/skins/src/font.h \
-       modules/gui/skins/src/graphics.cpp \
-       modules/gui/skins/src/graphics.h \
-       modules/gui/skins/src/skin_main.cpp \
-       modules/gui/skins/src/skin_common.h \
-       modules/gui/skins/src/theme.cpp \
-       modules/gui/skins/src/theme.h \
-       modules/gui/skins/src/themeloader.cpp \
-       modules/gui/skins/src/themeloader.h \
-       modules/gui/skins/src/vlcproc.cpp \
-       modules/gui/skins/src/vlcproc.h \
-       modules/gui/skins/src/window.cpp \
-       modules/gui/skins/src/window.h \
-       \
-       modules/gui/skins/win32/win32_api.cpp \
-       modules/gui/skins/win32/win32_bitmap.cpp \
-       modules/gui/skins/win32/win32_bitmap.h \
-       modules/gui/skins/win32/win32_dragdrop.cpp \
-       modules/gui/skins/win32/win32_dragdrop.h \
-       modules/gui/skins/win32/win32_event.cpp \
-       modules/gui/skins/win32/win32_event.h \
-       modules/gui/skins/win32/win32_font.cpp \
-       modules/gui/skins/win32/win32_font.h \
-       modules/gui/skins/win32/win32_graphics.cpp \
-       modules/gui/skins/win32/win32_graphics.h \
-       modules/gui/skins/win32/win32_run.cpp \
-       modules/gui/skins/win32/win32_theme.cpp \
-       modules/gui/skins/win32/win32_theme.h \
-       modules/gui/skins/win32/win32_window.cpp \
-       modules/gui/skins/win32/win32_window.h \
-       \
-       modules/gui/skins/gtk2/gtk2_api.cpp \
-       modules/gui/skins/gtk2/gtk2_bitmap.cpp \
-       modules/gui/skins/gtk2/gtk2_bitmap.h \
-       modules/gui/skins/gtk2/gtk2_dragdrop.cpp \
-       modules/gui/skins/gtk2/gtk2_dragdrop.h \
-       modules/gui/skins/gtk2/gtk2_event.cpp \
-       modules/gui/skins/gtk2/gtk2_event.h \
-       modules/gui/skins/gtk2/gtk2_font.cpp \
-       modules/gui/skins/gtk2/gtk2_font.h \
-       modules/gui/skins/gtk2/gtk2_graphics.cpp \
-       modules/gui/skins/gtk2/gtk2_graphics.h \
-       modules/gui/skins/gtk2/gtk2_run.cpp \
-       modules/gui/skins/gtk2/gtk2_theme.cpp \
-       modules/gui/skins/gtk2/gtk2_theme.h \
-       modules/gui/skins/gtk2/gtk2_window.cpp \
-       modules/gui/skins/gtk2/gtk2_window.h \
-       \
-       modules/gui/skins/x11/x11_api.cpp \
-       modules/gui/skins/x11/x11_bitmap.cpp \
-       modules/gui/skins/x11/x11_bitmap.h \
-       modules/gui/skins/x11/x11_dragdrop.cpp \
-       modules/gui/skins/x11/x11_dragdrop.h \
-       modules/gui/skins/x11/x11_event.cpp \
-       modules/gui/skins/x11/x11_event.h \
-       modules/gui/skins/x11/x11_font.cpp \
-       modules/gui/skins/x11/x11_font.h \
-       modules/gui/skins/x11/x11_graphics.cpp \
-       modules/gui/skins/x11/x11_graphics.h \
-       modules/gui/skins/x11/x11_run.cpp \
-       modules/gui/skins/x11/x11_theme.cpp \
-       modules/gui/skins/x11/x11_theme.h \
-       modules/gui/skins/x11/x11_window.cpp \
-       modules/gui/skins/x11/x11_window.h \
+       $(COMMON_skins) \
        $(NULL)
 
 EXTRA_DIST += \
index dda5ab9753659911f6594be316da901cf8853b5c..e55d0cfbcf8740ee762138150ebc9c7b1dbfd02e 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_run.cpp:
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_run.cpp,v 1.24 2003/05/12 17:33:19 gbazin Exp $
+ * $Id: gtk2_run.cpp,v 1.25 2003/06/03 22:18:58 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
 
-//--- WWWINDOWS -------------------------------------------------------------
-#ifndef BASIC_SKINS
-#include <wx/wx.h>
-#endif
-
 //--- VLC -------------------------------------------------------------------
 #include <vlc/intf.h>
 
 #include "../src/skin_common.h"
 #include "../src/vlcproc.h"
 
-#ifndef BASIC_SKINS
-#include "../../wxwindows/wxwindows.h"
-#include "share/vlc32x32.xpm"           // include the icon graphic
-#endif
-
-
 //---------------------------------------------------------------------------
 class CallBackObjects
 {
@@ -69,27 +58,6 @@ class CallBackObjects
 bool IsVLCEvent( unsigned int msg );
 int  SkinManage( intf_thread_t *p_intf );
 
-
-//---------------------------------------------------------------------------
-// Local classes declarations.
-//---------------------------------------------------------------------------
-#ifndef BASIC_SKINS
-class Instance: public wxApp
-{
-public:
-    Instance();
-    Instance( intf_thread_t *_p_intf, CallBackObjects *callback );
-
-    bool OnInit();
-    OpenDialog *open;
-
-private:
-    intf_thread_t *p_intf;
-    CallBackObjects *callbackobj;
-};
-#endif
-
-
 //---------------------------------------------------------------------------
 // GTK2 interface
 //---------------------------------------------------------------------------
@@ -156,9 +124,6 @@ void GTK2Proc( GdkEvent *event, gpointer data )
     {
         if( !proc->EventProc( evt ) )
         {
-#ifndef BASIC_SKINS
-            wxExit();
-#endif
             return;      // Exit VLC !
         }
     }
@@ -218,43 +183,6 @@ gboolean RefreshTimer( gpointer data )
 //---------------------------------------------------------------------------
 
 
-//---------------------------------------------------------------------------
-// Implementation of Instance class
-//---------------------------------------------------------------------------
-#ifndef BASIC_SKINS
-Instance::Instance( )
-{
-}
-
-Instance::Instance( intf_thread_t *_p_intf, CallBackObjects *callback )
-{
-    // Initialization
-    p_intf = _p_intf;
-    callbackobj = callback;
-}
-
-IMPLEMENT_APP_NO_MAIN(Instance)
-
-bool Instance::OnInit()
-{
-    // Set event callback. Yes, it's a big hack ;)
-    gdk_event_handler_set( GTK2Proc, (gpointer)callbackobj, NULL );
-
-    p_intf->p_sys->p_icon = new wxIcon( vlc_xpm );
-    p_intf->p_sys->OpenDlg = new OpenDialog( p_intf, NULL, FILE_ACCESS );
-    p_intf->p_sys->MessagesDlg = new Messages( p_intf, NULL );
-    p_intf->p_sys->SoutDlg = new SoutDialog( p_intf, NULL );
-    p_intf->p_sys->PrefsDlg = new PrefsDialog( p_intf, NULL );
-    p_intf->p_sys->InfoDlg = new FileInfo( p_intf, NULL );
-    
-    // Add timer
-    g_timeout_add( 200, (GSourceFunc)RefreshTimer, (gpointer)p_intf );
-
-    return TRUE;
-}
-#endif
-
-
 //---------------------------------------------------------------------------
 // GTK2 interface
 //---------------------------------------------------------------------------
index c61f088b25729dd42af80835a7d5e9712a25f571..33b580be092aa6797de643d2b7a56bea27b2747d 100644 (file)
@@ -2,7 +2,7 @@
  * skin_common.h: Private Skin interface description
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: skin_common.h,v 1.12 2003/06/01 22:11:24 asmax Exp $
+ * $Id: skin_common.h,v 1.13 2003/06/03 22:18:58 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
 #define SLIDER_RANGE        1048576  // 1024*1024
 #define DEFAULT_SKIN_FILE   "skins/default.vlt"
 
-
 class Theme;
-class OpenDialog;
-class Messages;
-class SoutDialog;
-class PrefsDialog;
-class FileInfo;
-#ifndef BASIC_SKINS
+class Dialogs;
 class wxIcon;
-#endif
-#ifdef WIN32
-class ExitTimer;
-#endif
 
 #ifdef X11_SKINS
 #include <X11/Xlib.h>
@@ -74,15 +64,11 @@ struct intf_sys_t
     int i_index;        // Set which file is being played
     int i_size;         // Size of playlist;
 
+    // Interface dialogs
+    Dialogs *p_dialogs;
+
 #ifndef BASIC_SKINS
-    wxIcon *p_icon;
-
-    // Dialogs
-    OpenDialog  *OpenDlg;
-    Messages    *MessagesDlg;
-    SoutDialog  *SoutDlg;
-    PrefsDialog *PrefsDlg;
-    FileInfo    *InfoDlg;
+    wxIcon      *p_icon;
 #endif
 
 #ifdef X11_SKINS
@@ -92,11 +78,6 @@ struct intf_sys_t
 #endif
 
 #ifdef WIN32
-#ifndef BASIC_SKINS
-    bool b_wx_die;
-    ExitTimer *p_kludgy_timer;
-#endif
-
     // We dynamically load msimg32.dll to get a pointer to TransparentBlt()
     HINSTANCE h_msimg32_dll;
     BOOL (WINAPI *TransparentBlt)( HDC,int,int,int,int,HDC,int,
@@ -109,5 +90,3 @@ struct intf_sys_t
 };
 
 #endif
-
-
index 15e2a6205c52ee36e8981bb86eb12d6a1a8c157e..2198445fc1bff650c05870c935df3c8a56c6ebcc 100644 (file)
@@ -2,7 +2,7 @@
  * skin-main.cpp: skins plugin for VLC
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: skin_main.cpp,v 1.30 2003/06/01 22:11:24 asmax Exp $
+ * $Id: skin_main.cpp,v 1.31 2003/06/03 22:18:58 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -49,6 +49,8 @@
 #include "themeloader.h"
 #include "vlcproc.h"
 #include "skin_common.h"
+#include "dialogs.h"
+
 #ifndef BASIC_SKINS
 #include "../../wxwindows/wxwindows.h"
 #endif
@@ -209,6 +211,13 @@ static void Run( intf_thread_t *p_intf )
 
     int a = OSAPI_GetTime();
 
+#ifndef 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
+
     // Load a theme
     char *skin_last = config_GetPsz( p_intf, "skin_last" );
     ThemeLoader *Loader = new ThemeLoader( p_intf );
@@ -235,17 +244,16 @@ static void Run( intf_thread_t *p_intf )
 #endif
         {
             // Last chance: the user can  select a new theme file
-// FIXME: wxWindows isn't initialized yet !!!
-#if 0
 #ifndef BASIC_SKINS
-            wxFileDialog dialog( NULL, _("Open a skin file"), "", "",
-                "Skin files (*.vlt)|*.vlt|Skin files (*.xml)|*.xml|"
-                    "All files|*.*", wxOPEN );
+            wxFileDialog dialog( NULL,
+                wxU(_("Open a skin file")), wxT(""), wxT(""),
+                wxT("Skin files (*.vlt)|*.vlt|Skin files (*.xml)|*.xml|"
+                    "All files|*.*"), wxOPEN );
 
             if( dialog.ShowModal() == wxID_OK )
             {
                 // try to load selected file
-                if( ! Loader->Load( dialog.GetPath().c_str() ) )
+                if( ! Loader->Load( (string)dialog.GetPath().mb_str() ) )
                 {
                     // He, he, what the hell is he doing ?
                     delete Loader;
@@ -253,7 +261,6 @@ static void Run( intf_thread_t *p_intf )
                 }
             }
             else
-#endif
 #endif
             {
                 delete Loader;
@@ -274,6 +281,11 @@ static void Run( intf_thread_t *p_intf )
     OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (int)true );
 
     OSRun( p_intf );
+
+#ifndef BASIC_SKINS
+    // clean up the dialog boxes
+    delete p_intf->p_sys->p_dialogs;
+#endif
 }
 
 //---------------------------------------------------------------------------
@@ -324,12 +336,12 @@ int SkinManage( intf_thread_t *p_intf )
 
     OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (long)false );
 
-#ifndef BASIC_SKINS
+#ifndef BASIC_SKINS //FIXME
     // Update the log window
-    p_intf->p_sys->MessagesDlg->UpdateLog();
+    p_intf->p_sys->p_dialogs->MessagesDlg->UpdateLog();
 
     // Update the file info window
-    p_intf->p_sys->InfoDlg->UpdateFileInfo();
+    p_intf->p_sys->p_dialogs->FileInfoDlg->UpdateFileInfo();
 #endif
 
     //-------------------------------------------------------------------------
index bf26dca93ab370ebf8518fe056786c92795fb7bc..23f2f3473be9f0bcff3a42d8d678d8e2446851a4 100644 (file)
@@ -2,7 +2,7 @@
  * vlcproc.cpp: VlcProc class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.cpp,v 1.28 2003/06/01 16:39:49 asmax Exp $
+ * $Id: vlcproc.cpp,v 1.29 2003/06/03 22:18:58 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -49,6 +49,7 @@
 #include "window.h"
 #include "vlcproc.h"
 #include "skin_common.h"
+#include "dialogs.h"
 
 #ifndef BASIC_SKINS
 #include "../../wxwindows/wxwindows.h"
@@ -103,10 +104,9 @@ bool VlcProc::EventProc( Event *evt )
 
         case VLC_OPEN:
 #ifndef BASIC_SKINS
-            wxMutexGuiEnter();
-            OpenFile( true );
-            wxMutexGuiLeave();
-#endif            
+            p_intf->p_sys->p_dialogs->ShowOpen( TRUE );
+            InterfaceRefresh();
+#endif
             return true;
 
         case VLC_LOAD_SKIN:
@@ -139,35 +139,25 @@ bool VlcProc::EventProc( Event *evt )
 
         case VLC_PLAYLIST_ADD_FILE:
 #ifndef BASIC_SKINS
-            wxMutexGuiEnter();
-            OpenFile( false );
-            wxMutexGuiLeave();
-#endif            
+            p_intf->p_sys->p_dialogs->ShowOpen( FALSE );
+            InterfaceRefresh();
+#endif
             return true;
 
 #ifndef BASIC_SKINS
         case VLC_LOG_SHOW:
-            wxMutexGuiEnter();
-            p_intf->p_sys->MessagesDlg->Show(
-                !p_intf->p_sys->MessagesDlg->IsShown() );
-            wxMutexGuiLeave();
+            p_intf->p_sys->p_dialogs->ShowMessages();
             return true;
 
         case VLC_LOG_CLEAR:
             return true;
 
         case VLC_PREFS_SHOW:
-            wxMutexGuiEnter();
-            p_intf->p_sys->PrefsDlg->Show(
-                !p_intf->p_sys->PrefsDlg->IsShown() );
-            wxMutexGuiLeave();
+            p_intf->p_sys->p_dialogs->ShowPrefs();
             return true;
 
         case VLC_INFO_SHOW:
-            wxMutexGuiEnter();
-            p_intf->p_sys->InfoDlg->Show(
-                !p_intf->p_sys->InfoDlg->IsShown() );
-            wxMutexGuiLeave();
+            p_intf->p_sys->p_dialogs->ShowFileInfo();
             return true;
 #endif
 
@@ -405,50 +395,6 @@ void VlcProc::LoadSkin()
 #endif
 }
 //---------------------------------------------------------------------------
-void VlcProc::OpenFile( bool play )
-{
-#ifndef BASIC_SKINS
-    if( p_intf->p_sys->OpenDlg->ShowModal() != wxID_OK )
-    {
-        return;
-    }
-
-    // Check if playlist is available
-    playlist_t *p_playlist = p_intf->p_sys->p_playlist;
-    if( p_playlist == NULL )
-    {
-        return;
-    }
-
-    if( play )
-    {
-        // Append and play
-        for( size_t i = 0; i < p_intf->p_sys->OpenDlg->mrl.GetCount(); i++ )
-        {
-            playlist_Add( p_playlist,
-                (const char *)p_intf->p_sys->OpenDlg->mrl[i].mb_str(),
-                PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), PLAYLIST_END );
-        }
-        p_intf->p_sys->p_theme->EvtBank->Get( "play" )->SendEvent();
-    }
-    else
-    {
-        // Append only
-        for( size_t i = 0; i < p_intf->p_sys->OpenDlg->mrl.GetCount(); i++ )
-        {
-            playlist_Add( p_playlist,
-                (const char *)p_intf->p_sys->OpenDlg->mrl[i].mb_str(),
-                PLAYLIST_APPEND, PLAYLIST_END );
-        }
-    }
-
-    // Refresh interface !
-    p_intf->p_sys->p_theme->EvtBank->Get( "playlist_refresh" )
-        ->PostSynchroMessage();
-    InterfaceRefresh();
-#endif
-}
-//---------------------------------------------------------------------------
 void VlcProc::DropFile( unsigned int param )
 {
     // Get pointer to file
@@ -628,4 +574,3 @@ void VlcProc::AddNetworkUDP( int port )
     InterfaceRefresh();
 }
 //---------------------------------------------------------------------------
-
index 96c6c3474d976957dfdc3ebcf4c7dc84f0075c24..1675a624a0e09f516be61188e50a67004b263208 100644 (file)
@@ -2,7 +2,7 @@
  * vlcproc.h: VlcProc class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.h,v 1.5 2003/05/05 16:29:57 gbazin Exp $
+ * $Id: vlcproc.h,v 1.6 2003/06/03 22:18:58 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -42,7 +42,6 @@ class VlcProc
 
         // Vlc methods
         void LoadSkin();
-        void OpenFile( bool play );
         void DropFile( unsigned int param );
         void PauseStream();
         void PlayStream();
index 492c48610c69fb2892e863f146b6482edc399576..888516c2020e378289497372972419b8dbb1e787 100644 (file)
@@ -2,7 +2,7 @@
  * win32_run.cpp:
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: win32_run.cpp,v 1.17 2003/05/26 02:09:27 gbazin Exp $
+ * $Id: win32_run.cpp,v 1.18 2003/06/03 22:18:58 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
 #include <vlc/intf.h>
 
 //--- GENERAL ---------------------------------------------------------------
-#ifndef 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
-
 #include <windows.h>
 
 //--- SKIN ------------------------------------------------------------------
 #include "../src/skin_common.h"
 #include "../src/vlcproc.h"
 
-#ifndef BASIC_SKINS
-#include "../../wxwindows/wxwindows.h"
-#include "share/vlc32x32.xpm"       // include the graphic icon
-#endif
-
 //---------------------------------------------------------------------------
 // Specific method
 //---------------------------------------------------------------------------
 bool IsVLCEvent( unsigned int msg );
 int  SkinManage( intf_thread_t *p_intf );
 
-
-#ifndef BASIC_SKINS
-//---------------------------------------------------------------------------
-// Local classes declarations.
-//---------------------------------------------------------------------------
-class Instance: public wxApp
-{
-public:
-    Instance();
-    Instance( intf_thread_t *_p_intf );
-
-    bool OnInit();
-    int  OnExit();
-    OpenDialog *open;
-
-private:
-    intf_thread_t *p_intf;
-};
-
-class ExitTimer: public wxTimer
-{
-public:
-    ExitTimer( intf_thread_t *_p_intf );
-
-    void Notify();
-
-private:
-    intf_thread_t *p_intf;
-};
-
-
-//---------------------------------------------------------------------------
-// Implementation of Instance class
-//---------------------------------------------------------------------------
-Instance::Instance( )
-{
-}
-
-Instance::Instance( intf_thread_t *_p_intf )
-{
-    // Initialization
-    p_intf = _p_intf;
-}
-
-IMPLEMENT_APP_NO_MAIN(Instance)
-
-bool Instance::OnInit()
-{
-    p_intf->p_sys->p_icon = new wxIcon( vlc_xpm );
-
-    // Create all the dialog boxes
-    p_intf->p_sys->OpenDlg = new OpenDialog( p_intf, NULL, FILE_ACCESS );
-    p_intf->p_sys->MessagesDlg = new Messages( p_intf, NULL );
-    p_intf->p_sys->SoutDlg = new SoutDialog( p_intf, NULL );
-    p_intf->p_sys->PrefsDlg = new PrefsDialog( p_intf, NULL );
-    p_intf->p_sys->InfoDlg = new FileInfo( p_intf, NULL );
-
-    // Start a timer checking if we must exit the main loop
-    p_intf->p_sys->b_wx_die = 0;
-    p_intf->p_sys->p_kludgy_timer = new ExitTimer( p_intf );
-    p_intf->p_sys->p_kludgy_timer->Start( 100 );
-
-    // OK, initialization is over, now the other thread can go on working...
-    vlc_thread_ready( p_intf );
-
-    return TRUE;
-}
-
-int Instance::OnExit()
-{
-    // Delete evertything
-    delete p_intf->p_sys->p_kludgy_timer;
-    delete p_intf->p_sys->InfoDlg;
-    delete p_intf->p_sys->PrefsDlg;
-    delete p_intf->p_sys->SoutDlg;
-    delete p_intf->p_sys->MessagesDlg;
-    delete p_intf->p_sys->OpenDlg;
-    delete p_intf->p_sys->p_icon;
-
-    return 0;
-}
-
-
-//---------------------------------------------------------------------------
-// Implementation of ExitTimer class
-// This timer is only there to call wxApp::ExitMainLoop() from the wxWindows
-// thread (otherwise we never exit from the wxEntry call).
-//---------------------------------------------------------------------------
-ExitTimer::ExitTimer( intf_thread_t *_p_intf ) : wxTimer()
-{
-    p_intf = _p_intf;
-}
-
-void ExitTimer::Notify()
-{
-    if( p_intf->p_sys->b_wx_die )
-        wxTheApp->ExitMainLoop();
-}
-
-
-//---------------------------------------------------------------------------
-#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
-
-
-//---------------------------------------------------------------------------
-// Thread callback
-// We create all wxWindows dialogs in a separate thread because we don't want
-// any interaction with our own message loop
-//---------------------------------------------------------------------------
-void SkinsDialogsThread( intf_thread_t *p_intf )
-{
-    /* 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
-
-    return;
-}
-
-#endif // WX_SKINS
-
 //---------------------------------------------------------------------------
 // Refresh Timer Callback
 //---------------------------------------------------------------------------
@@ -214,7 +62,6 @@ void CALLBACK RefreshTimer( HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime )
 //---------------------------------------------------------------------------
 
 
-
 //---------------------------------------------------------------------------
 // Win32 interface
 //---------------------------------------------------------------------------
@@ -226,17 +73,6 @@ void OSRun( intf_thread_t *p_intf )
     Event *ProcessEvent;
     int KeyModifier = 0;
 
-#ifndef BASIC_SKINS
-    // Create a new thread for wxWindows
-    if( vlc_thread_create( p_intf, "Skins Dialogs Thread", SkinsDialogsThread,
-                           0, VLC_TRUE ) )
-    {
-        msg_Err( p_intf, "cannot create SkinsDialogsThread" );
-        // Don't even enter the main loop
-        return;
-    }
-#endif
-
      // Create refresh timer
     SetTimer( ((OSTheme *)p_intf->p_sys->p_theme)->GetParentWindow(), 42, 200,
               (TIMERPROC)RefreshTimer );
@@ -349,11 +185,6 @@ void OSRun( intf_thread_t *p_intf )
         // Check if vlc is closing
         Proc->IsClosing();
     }
-
-#ifndef BASIC_SKINS
-    // Tell wxWindows it's time to exit
-    p_intf->p_sys->b_wx_die = 1;
-#endif
 }
 //---------------------------------------------------------------------------
 bool IsVLCEvent( unsigned int msg )
index c972f079cc5d414bdc838e2ac076200c4c3467da..8a1c9097f80dd144db8de3e5604b1d31d35c7ee4 100644 (file)
@@ -2,7 +2,7 @@
  * x11_run.cpp:
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: x11_run.cpp,v 1.13 2003/06/01 22:11:24 asmax Exp $
+ * $Id: x11_run.cpp,v 1.14 2003/06/03 22:18:58 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
 //--- X11 -------------------------------------------------------------------
 #include <X11/Xlib.h>
 
-//--- WXWINDOWS -------------------------------------------------------------
-#ifndef BASIC_SKINS
-/* Let vlc take care of the i18n stuff */
-#define WXINTL_NO_GETTEXT_MACRO
-#include <wx/wx.h>
-#endif
-
 //--- VLC -------------------------------------------------------------------
 #include <vlc/intf.h>
 
 #include "../src/skin_common.h"
 #include "../src/vlcproc.h"
 
-#ifndef BASIC_SKINS
-#include "../../wxwindows/wxwindows.h"
-#endif
-
-// include the icon graphic
-#include "share/vlc32x32.xpm"
-
 //---------------------------------------------------------------------------
 // Specific method
 //---------------------------------------------------------------------------
 bool IsVLCEvent( unsigned int msg );
 int  SkinManage( intf_thread_t *p_intf );
 
-
-#ifndef BASIC_SKINS
-//---------------------------------------------------------------------------
-// Local classes declarations.
-//---------------------------------------------------------------------------
-class Instance: public wxApp
-{
-public:
-    Instance();
-    Instance( intf_thread_t *_p_intf );
-
-    bool OnInit();
-    int  OnExit();
-    OpenDialog *open;
-
-private:
-    intf_thread_t *p_intf;
-};
-
-//---------------------------------------------------------------------------
-// Implementation of Instance class
-//---------------------------------------------------------------------------
-Instance::Instance( )
-{
-}
-
-Instance::Instance( intf_thread_t *_p_intf )
-{
-    // Initialization
-    p_intf = _p_intf;
-}
-
-IMPLEMENT_APP_NO_MAIN(Instance)
-
-bool Instance::OnInit()
-{
-    p_intf->p_sys->p_icon = new wxIcon( vlc_xpm );
-
-    // Create all the dialog boxes
-    p_intf->p_sys->OpenDlg = new OpenDialog( p_intf, NULL, FILE_ACCESS );
-    p_intf->p_sys->MessagesDlg = new Messages( p_intf, NULL );
-    p_intf->p_sys->SoutDlg = new SoutDialog( p_intf, NULL );
-    p_intf->p_sys->PrefsDlg = new PrefsDialog( p_intf, NULL );
-    p_intf->p_sys->InfoDlg = new FileInfo( p_intf, NULL );
-
-    // OK, initialization is over, now the other thread can go on working...
-    vlc_thread_ready( p_intf );
-
-    return TRUE;
-}
-
-int Instance::OnExit()
-{
-    // Delete evertything
-    delete p_intf->p_sys->InfoDlg;
-    delete p_intf->p_sys->PrefsDlg;
-    delete p_intf->p_sys->SoutDlg;
-    delete p_intf->p_sys->MessagesDlg;
-    delete p_intf->p_sys->OpenDlg;
-    delete p_intf->p_sys->p_icon;
-
-    return 0;
-}
-
-//---------------------------------------------------------------------------
-// Thread callback
-// We create all wxWindows dialogs in a separate thread because we don't want
-// any interaction with our own message loop
-//---------------------------------------------------------------------------
-void SkinsDialogsThread( intf_thread_t *p_intf )
-{
-    /* Hack to pass the p_intf pointer to the new wxWindow Instance object */
-    wxTheApp = new Instance( p_intf );
-
-    static char  *p_args[] = { "" };
-    wxEntry( 1, p_args );
-
-    return;
-}
-
-#endif // WX_SKINS
-
 //---------------------------------------------------------------------------
 // X11 event processing
 //---------------------------------------------------------------------------
@@ -203,9 +107,6 @@ int ProcessEvent( intf_thread_t *p_intf, VlcProc *proc, XEvent *event )
     {
         if( !proc->EventProc( evt ) )
         {
-#ifndef BASIC_SKINS
-            wxExit();
-#endif
             return 1;      // Exit VLC !
         }
     }
@@ -259,17 +160,6 @@ void OSRun( intf_thread_t *p_intf )
 
     Display *display = ((OSTheme *)p_intf->p_sys->p_theme)->GetDisplay();
 
-#ifndef BASIC_SKINS
-    // Create a new thread for wxWindows
-    if( vlc_thread_create( p_intf, "Skins Dialogs Thread", SkinsDialogsThread,
-                           0, VLC_TRUE ) )
-    {
-        msg_Err( p_intf, "cannot create SkinsDialogsThread" );
-        // Don't even enter the main loop
-        return;
-    }
-#endif
-    
     // Main event loop
     int close = 0;
     int count = 0;
index 1d4a1c47db0ea5e6e2f0cdabb4c49544c7cb5a1c..1260c5f164f9054e00da07fc19e992822edd2480 100644 (file)
@@ -2,7 +2,7 @@
  * streamout.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: streamout.cpp,v 1.15 2003/05/22 22:24:34 gbazin Exp $
+ * $Id: streamout.cpp,v 1.16 2003/06/03 22:18:58 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -94,8 +94,8 @@ enum
 
     AccessType1_Event, AccessType2_Event, AccessType3_Event,
     AccessType4_Event, AccessType5_Event,
-    NetPort_Event,
-    NetAddr_Event,
+    NetPort1_Event, NetPort2_Event, NetPort3_Event,
+    NetAddr1_Event, NetAddr2_Event, NetAddr3_Event,
 
     EncapsulationRadio1_Event, EncapsulationRadio2_Event,
     EncapsulationRadio3_Event, EncapsulationRadio4_Event,
@@ -118,9 +118,13 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
     EVT_CHECKBOX(AccessType5_Event, SoutDialog::OnAccessTypeChange)
     EVT_TEXT(FileName_Event, SoutDialog::OnFileChange)
     EVT_BUTTON(FileBrowse_Event, SoutDialog::OnFileBrowse)
-    EVT_TEXT(NetPort_Event, SoutDialog::OnNetChange)
-    EVT_SPINCTRL(NetPort_Event, SoutDialog::OnNetChange)
-    EVT_TEXT(NetAddr_Event, SoutDialog::OnNetChange)
+
+    EVT_TEXT(NetPort1_Event, SoutDialog::OnNetChange)
+    EVT_TEXT(NetAddr1_Event, SoutDialog::OnNetChange)
+    EVT_TEXT(NetPort2_Event, SoutDialog::OnNetChange)
+    EVT_TEXT(NetAddr2_Event, SoutDialog::OnNetChange)
+    EVT_TEXT(NetPort3_Event, SoutDialog::OnNetChange)
+    EVT_TEXT(NetAddr3_Event, SoutDialog::OnNetChange)
  
     /* Events generated by the encapsulation panel */
     EVT_RADIOBUTTON(EncapsulationRadio1_Event,
@@ -286,8 +290,9 @@ void SoutDialog::UpdateMRL()
         if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
         dup_opts += wxT("dst=std{access=http,mux=");
         dup_opts += encapsulation + wxT(",url=");
-        dup_opts += net_addr->GetLineText(0);
-        dup_opts += wxString::Format( wxT(":%d"), net_port->GetValue() );
+        dup_opts += net_addrs[HTTP_ACCESS_OUT]->GetLineText(0);
+        dup_opts += wxString::Format( wxT(":%d"),
+                                      net_ports[HTTP_ACCESS_OUT]->GetValue() );
         dup_opts += wxT("}");
     }
     if( access_checkboxes[UDP_ACCESS_OUT]->IsChecked() )
@@ -295,8 +300,9 @@ void SoutDialog::UpdateMRL()
         if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
         dup_opts += wxT("dst=std{access=udp,mux=");
         dup_opts += encapsulation + wxT(",url=");
-        dup_opts += net_addr->GetLineText(0);
-        dup_opts += wxString::Format( wxT(":%d"), net_port->GetValue() );
+        dup_opts += net_addrs[UDP_ACCESS_OUT]->GetLineText(0);
+        dup_opts += wxString::Format( wxT(":%d"),
+                                      net_ports[UDP_ACCESS_OUT]->GetValue() );
         dup_opts += wxT("}");
     }
     if( access_checkboxes[RTP_ACCESS_OUT]->IsChecked() )
@@ -304,8 +310,9 @@ void SoutDialog::UpdateMRL()
         if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
         dup_opts += wxT("dst=std{access=rtp,mux=");
         dup_opts += encapsulation + wxT(",url=");
-        dup_opts += net_addr->GetLineText(0);
-        dup_opts += wxString::Format( wxT(":%d"), net_port->GetValue() );
+        dup_opts += net_addrs[RTP_ACCESS_OUT]->GetLineText(0);
+        dup_opts += wxString::Format( wxT(":%d"),
+                                      net_ports[RTP_ACCESS_OUT]->GetValue() );
         dup_opts += wxT("}");
     }
 
@@ -374,21 +381,23 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent )
     access_subpanels[1]->SetSizerAndFit( subpanel_sizer );
 
     /* Net rows */
-    for( i=2; i < ACCESS_OUT_NUM; i++ )
+    for( i = HTTP_ACCESS_OUT; i < ACCESS_OUT_NUM; i++ )
     {
         subpanel_sizer = new wxFlexGridSizer( 4, 1, 20 );
         label = new wxStaticText( access_subpanels[i], -1, wxU(_("Address")) );
-        net_addr = new wxTextCtrl( access_subpanels[i], NetAddr_Event, wxT(""),
-                                   wxDefaultPosition, wxSize( 200, -1 ),
-                                   wxTE_PROCESS_ENTER);
+        net_addrs[i] = new wxTextCtrl( access_subpanels[i],
+                                   NetAddr1_Event + i - HTTP_ACCESS_OUT,
+                                   wxT(""), wxDefaultPosition,
+                                   wxSize( 200, -1 ), wxTE_PROCESS_ENTER);
         subpanel_sizer->Add( label, 0,
                              wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
-        subpanel_sizer->Add( net_addr, 1, wxEXPAND |
+        subpanel_sizer->Add( net_addrs[i], 1, wxEXPAND |
                              wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
 
         int val = config_GetInt( p_intf, "server-port" );
         label = new wxStaticText( access_subpanels[i], -1, wxU(_("Port")) );
-        net_port = new wxSpinCtrl( access_subpanels[i], NetPort_Event,
+        net_ports[i] = new wxSpinCtrl( access_subpanels[i],
+                                   NetPort1_Event + i - HTTP_ACCESS_OUT,
                                    wxString::Format(wxT("%d"), val),
                                    wxDefaultPosition, wxDefaultSize,
                                    wxSP_ARROW_KEYS,
@@ -396,7 +405,7 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent )
 
         subpanel_sizer->Add( label, 0,
                              wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
-        subpanel_sizer->Add( net_port, 0,
+        subpanel_sizer->Add( net_ports[i], 0,
                              wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
 
         access_subpanels[i]->SetSizerAndFit( subpanel_sizer );
index 54e37809a5c3cb756bbc74c014fa9bcf99db4fcc..cb57a12f0b5b2bd92bc81e64a5489361efdf5406 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.h: private wxWindows interface description
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: wxwindows.h,v 1.33 2003/05/27 11:35:34 gbazin Exp $
+ * $Id: wxwindows.h,v 1.34 2003/06/03 22:18:58 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -355,8 +355,8 @@ private:
     int i_access_type;
 
     wxComboBox *file_combo;
-    wxSpinCtrl *net_port;
-    wxTextCtrl *net_addr;
+    wxSpinCtrl *net_ports[5];
+    wxTextCtrl *net_addrs[5];
 
     /* Controls for the encapsulation */
     wxRadioButton *encapsulation_radios[5];