* 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).
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`"
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
-SOURCES_skins = \
+COMMON_skins = \
modules/gui/skins/os_api.h \
modules/gui/skins/os_bitmap.h \
modules/gui/skins/os_event.h \
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 \
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 \
$(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 += \
* 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
{
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
//---------------------------------------------------------------------------
{
if( !proc->EventProc( evt ) )
{
-#ifndef BASIC_SKINS
- wxExit();
-#endif
return; // Exit VLC !
}
}
//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-// 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
//---------------------------------------------------------------------------
* 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>
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
#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,
};
#endif
-
-
* 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>
#include "themeloader.h"
#include "vlcproc.h"
#include "skin_common.h"
+#include "dialogs.h"
+
#ifndef BASIC_SKINS
#include "../../wxwindows/wxwindows.h"
#endif
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 );
#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;
}
}
else
-#endif
#endif
{
delete Loader;
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
}
//---------------------------------------------------------------------------
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
//-------------------------------------------------------------------------
* 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>
#include "window.h"
#include "vlcproc.h"
#include "skin_common.h"
+#include "dialogs.h"
#ifndef BASIC_SKINS
#include "../../wxwindows/wxwindows.h"
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:
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
#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
InterfaceRefresh();
}
//---------------------------------------------------------------------------
-
* 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>
// Vlc methods
void LoadSkin();
- void OpenFile( bool play );
void DropFile( unsigned int param );
void PauseStream();
void PlayStream();
* 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
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
-
//---------------------------------------------------------------------------
// Win32 interface
//---------------------------------------------------------------------------
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 );
// 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 )
* 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
//---------------------------------------------------------------------------
{
if( !proc->EventProc( evt ) )
{
-#ifndef BASIC_SKINS
- wxExit();
-#endif
return 1; // Exit VLC !
}
}
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;
* 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>
*
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,
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,
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() )
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() )
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("}");
}
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,
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 );
* 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>
*
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];