pOsFactory->removeFromTray();
}
+
+void CmdAddInTaskBar::execute()
+{
+ // Get the instance of OSFactory
+ OSFactory *pOsFactory = OSFactory::instance( getIntf() );
+ pOsFactory->addInTaskBar();
+}
+
+
+void CmdRemoveFromTaskBar::execute()
+{
+ // Get the instance of OSFactory
+ OSFactory *pOsFactory = OSFactory::instance( getIntf() );
+ pOsFactory->removeFromTaskBar();
+}
+
#include "cmd_generic.hpp"
-/// Command to minimize VLC
DEFINE_COMMAND(Minimize, "minimize" )
DEFINE_COMMAND(Restore, "restore" )
DEFINE_COMMAND(AddInTray, "add in tray" )
DEFINE_COMMAND(RemoveFromTray, "remove from tray" )
+DEFINE_COMMAND(AddInTaskBar, "add in taskbar" )
+DEFINE_COMMAND(RemoveFromTaskBar, "remove from taskbar" )
#endif
// TODO
}
+void MacOSXFactory::addInTaskBar()
+{
+ // TODO
+}
+
+void MacOSXFactory::removeFromTaskBar()
+{
+ // TODO
+}
+
OSTimer *MacOSXFactory::createOSTimer( const Callback &rCallback )
{
return new MacOSXTimer( getIntf(), rCallback );
/// Remove the icon from the system tray
virtual void removeFromTray();
+ /// Show the task in the task bar
+ virtual void addInTaskBar();
+
+ /// Remove the task from the task bar
+ virtual void removeFromTaskBar();
+
/// Instantiate an OSWindow object
virtual OSWindow *createOSWindow( GenericWindow &rWindow,
bool dragDrop, bool playOnDrop,
/// Remove the icon from the system tray
virtual void removeFromTray() = 0;
+ /// Show the task in the task bar
+ virtual void addInTaskBar() = 0;
+
+ /// Remove the task from the task bar
+ virtual void removeFromTaskBar() = 0;
+
/// Instantiate an OSTimer with the given command
virtual OSTimer *createOSTimer( CmdGeneric &rCmd ) = 0;
static int onSystrayChange( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldVal, vlc_value_t newVal,
void *pParam );
+static int onTaskBarChange( vlc_object_t *pObj, const char *pVariable,
+ vlc_value_t oldVal, vlc_value_t newVal,
+ void *pParam );
//---------------------------------------------------------------------------
}
+/// Callback for the systray configuration option
+static int onTaskBarChange( vlc_object_t *pObj, const char *pVariable,
+ vlc_value_t oldVal, vlc_value_t newVal,
+ void *pParam )
+{
+ intf_thread_t *pIntf =
+ (intf_thread_t*)vlc_object_find( pObj, VLC_OBJECT_INTF, FIND_ANYWHERE );
+
+ if( pIntf == NULL )
+ {
+ return VLC_EGENERIC;
+ }
+
+ AsyncQueue *pQueue = AsyncQueue::instance( pIntf );
+ if( newVal.b_bool )
+ {
+ CmdAddInTaskBar *pCmd = new CmdAddInTaskBar( pIntf );
+ pQueue->push( CmdGenericPtr( pCmd ) );
+ }
+ else
+ {
+ CmdRemoveFromTaskBar *pCmd = new CmdRemoveFromTaskBar( pIntf );
+ pQueue->push( CmdGenericPtr( pCmd ) );
+ }
+
+ vlc_object_release( pIntf );
+}
+
+
//---------------------------------------------------------------------------
// Module descriptor
//---------------------------------------------------------------------------
"This option is updated automatically, do not touch it." )
#define SKINS2_SYSTRAY N_("Systray icon")
#define SKINS2_SYSTRAY_LONG N_("Show a systray icon for VLC")
+#define SKINS2_TASKBAR N_("Show VLC on the taskbar")
+#define SKINS2_TASKBAR_LONG N_("Show VLC on the taskbar")
#define SKINS2_TRANSPARENCY N_("Enable transparency effects")
#define SKINS2_TRANSPARENCY_LONG N_("You can disable all transparency effects"\
" if you want. This is mainly useful when moving windows does not behave" \
#ifdef WIN32
add_bool( "skins2-systray", VLC_FALSE, onSystrayChange, SKINS2_SYSTRAY,
SKINS2_SYSTRAY_LONG, VLC_FALSE );
+ add_bool( "skins2-taskbar", VLC_TRUE, onTaskBarChange, SKINS2_TASKBAR,
+ SKINS2_TASKBAR_LONG, VLC_FALSE );
add_bool( "skins2-transparency", VLC_FALSE, NULL, SKINS2_TRANSPARENCY,
SKINS2_TRANSPARENCY_LONG, VLC_FALSE );
#endif
}
// Create Window
- m_hParentWindow = CreateWindowEx( WS_EX_APPWINDOW, _T("SkinWindowClass"),
+ m_hParentWindow = CreateWindowEx( WS_EX_TOOLWINDOW, _T("SkinWindowClass"),
_T("VLC media player"), WS_SYSMENU|WS_POPUP,
-200, -200, 0, 0, 0, 0, m_hInst, 0 );
if( m_hParentWindow == NULL )
// Store with it a pointer to the interface thread
SetWindowLongPtr( m_hParentWindow, GWLP_USERDATA, (LONG_PTR)getIntf() );
+ // We do it this way otherwise CreateWindowEx will fail
+ // if WS_EX_LAYERED is not supported
+ SetWindowLongPtr( m_hParentWindow, GWL_EXSTYLE,
+ GetWindowLong( m_hParentWindow, GWL_EXSTYLE ) |
+ WS_EX_LAYERED );
+
+ ShowWindow( m_hParentWindow, SW_SHOW );
+
// Initialize the systray icon
m_trayIcon.cbSize = sizeof( NOTIFYICONDATA );
m_trayIcon.hWnd = m_hParentWindow;
addInTray();
}
- // We do it this way otherwise CreateWindowEx will fail
- // if WS_EX_LAYERED is not supported
- SetWindowLongPtr( m_hParentWindow, GWL_EXSTYLE,
- GetWindowLong( m_hParentWindow, GWL_EXSTYLE ) |
- WS_EX_LAYERED );
-
- ShowWindow( m_hParentWindow, SW_SHOW );
+ // Show the task in the task bar if needed
+ if( config_GetInt( getIntf(), "skins2-taskbar" ) )
+ {
+ addInTaskBar();
+ }
// Initialize the OLE library (for drag & drop)
OleInitialize( NULL );
Shell_NotifyIcon( NIM_DELETE, &m_trayIcon );
}
+void Win32Factory::addInTaskBar()
+{
+ ShowWindow( m_hParentWindow, SW_HIDE );
+ SetWindowLongPtr( m_hParentWindow, GWL_EXSTYLE,
+ WS_EX_LAYERED|WS_EX_APPWINDOW );
+ ShowWindow( m_hParentWindow, SW_SHOW );
+}
+
+void Win32Factory::removeFromTaskBar()
+{
+ ShowWindow( m_hParentWindow, SW_HIDE );
+ SetWindowLongPtr( m_hParentWindow, GWL_EXSTYLE,
+ WS_EX_LAYERED|WS_EX_TOOLWINDOW );
+ ShowWindow( m_hParentWindow, SW_SHOW );
+}
+
OSTimer *Win32Factory::createOSTimer( CmdGeneric &rCmd )
{
return new Win32Timer( getIntf(), rCmd, m_hParentWindow );
/// Remove the icon from the system tray
virtual void removeFromTray();
+ /// Show the task in the task bar
+ virtual void addInTaskBar();
+
+ /// Remove the task from the task bar
+ virtual void removeFromTaskBar();
+
/// Instantiate an OSTimer with the given command
virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
// TODO
}
+void X11Factory::addInTaskBar()
+{
+ // TODO
+}
+
+void X11Factory::removeFromTaskBar()
+{
+ // TODO
+}
+
OSTimer *X11Factory::createOSTimer( CmdGeneric &rCmd )
{
return new X11Timer( getIntf(), rCmd );
/// Remove the icon from the system tray
virtual void removeFromTray();
+ /// Show the task in the task bar
+ virtual void addInTaskBar();
+
+ /// Remove the task from the task bar
+ virtual void removeFromTaskBar();
+
/// Instantiate an OSWindow object
virtual OSWindow *createOSWindow( GenericWindow &rWindow,
bool dragDrop, bool playOnDrop,