/*****************************************************************************
* x11_factory.cpp
*****************************************************************************
- * Copyright (C) 2003 VideoLAN
+ * Copyright (C) 2003 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
- * Olivier Teulière <ipkiss@via.ecp.fr>
+ * Olivier Teulière <ipkiss@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef X11_SKINS
#include <dirent.h>
#include <sys/stat.h>
#include <X11/Xlib.h>
+#include <limits.h>
#include "x11_factory.hpp"
#include "x11_display.hpp"
#include "x11_graphics.hpp"
#include "x11_loop.hpp"
+#include "x11_popup.hpp"
#include "x11_timer.hpp"
#include "x11_window.hpp"
#include "x11_tooltip.hpp"
+#include "../src/generic_window.hpp"
+
+#include <vlc_common.h>
+#include <vlc_xlib.h>
X11Factory::X11Factory( intf_thread_t *pIntf ): OSFactory( pIntf ),
m_pDisplay( NULL ), m_pTimerLoop( NULL ), m_dirSep( "/" )
bool X11Factory::init()
{
+ // make sure xlib is safe-thread
+ if( !vlc_xlib_init( VLC_OBJECT( getIntf() ) ) )
+ {
+ msg_Err( getIntf(), "initializing xlib for multi-threading failed" );
+ return false;
+ }
+
// Create the X11 display
m_pDisplay = new X11Display( getIntf() );
ConnectionNumber( pDisplay ) );
// Initialize the resource path
- m_resourcePath.push_back( (string)getIntf()->p_vlc->psz_homedir +
- m_dirSep + CONFIG_DIR + "/skins2" );
+ char *datadir = config_GetUserDir( VLC_DATA_DIR );
+ m_resourcePath.push_back( (string)datadir + "/skins2" );
+ free( datadir );
m_resourcePath.push_back( (string)"share/skins2" );
- m_resourcePath.push_back( (string)DATA_PATH + "/skins2" );
+ datadir = config_GetDataDir( getIntf() );
+ m_resourcePath.push_back( (string)datadir + "/skins2" );
+ free( datadir );
return true;
}
X11Loop::destroy( getIntf() );
}
+void X11Factory::minimize()
+{
+ XIconifyWindow( m_pDisplay->getDisplay(), m_pDisplay->getMainWindow(),
+ DefaultScreen( m_pDisplay->getDisplay() ) );
+}
+
+void X11Factory::restore()
+{
+ // TODO
+}
+
+void X11Factory::addInTray()
+{
+ // TODO
+}
+
+void X11Factory::removeFromTray()
+{
+ // TODO
+}
-OSTimer *X11Factory::createOSTimer( const Callback &rCallback )
+void X11Factory::addInTaskBar()
{
- return new X11Timer( getIntf(), rCallback );
+ // TODO
+}
+
+void X11Factory::removeFromTaskBar()
+{
+ // TODO
+}
+
+OSTimer *X11Factory::createOSTimer( CmdGeneric &rCmd )
+{
+ return new X11Timer( getIntf(), rCmd );
}
OSWindow *X11Factory::createOSWindow( GenericWindow &rWindow, bool dragDrop,
- bool playOnDrop, OSWindow *pParent )
+ bool playOnDrop, OSWindow *pParent,
+ GenericWindow::WindowType_t type )
{
return new X11Window( getIntf(), rWindow, *m_pDisplay, dragDrop,
- playOnDrop, (X11Window*)pParent );
+ playOnDrop, (X11Window*)pParent, type );
}
}
+OSPopup *X11Factory::createOSPopup()
+{
+ return new X11Popup( getIntf(), *m_pDisplay );
+}
+
+
int X11Factory::getScreenWidth() const
{
Display *pDisplay = m_pDisplay->getDisplay();
}
-Rect X11Factory::getWorkArea() const
+SkinsRect X11Factory::getWorkArea() const
{
// XXX
- return Rect( 0, 0, getScreenWidth(), getScreenHeight() );
+ return SkinsRect( 0, 0, getScreenWidth(), getScreenHeight() );
}