]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/x11/x11_factory.cpp
Qt menus: remove useless FindActionWithText
[vlc] / modules / gui / skins2 / x11 / x11_factory.cpp
index e4a7b6c589d13c567900492886ee8ba355bef95a..815a169a47e91e29543a4e38f89b3ef519e432ea 100644 (file)
@@ -1,11 +1,11 @@
 /*****************************************************************************
  * 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
@@ -19,7 +19,7 @@
  *
  * 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 "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"
 
 
 X11Factory::X11Factory( intf_thread_t *pIntf ): OSFactory( pIntf ),
-    m_pDisplay( NULL ), m_pTimerLoop( NULL )
+    m_pDisplay( NULL ), m_pTimerLoop( NULL ), m_dirSep( "/" )
 {
     // see init()
 }
@@ -69,6 +70,13 @@ bool X11Factory::init()
     m_pTimerLoop = new X11TimerLoop( getIntf(),
                                      ConnectionNumber( pDisplay ) );
 
+    // Initialize the resource path
+    char *datadir = config_GetUserDataDir();
+    m_resourcePath.push_back( (string)datadir + "/skins2" );
+    free( datadir );
+    m_resourcePath.push_back( (string)"share/skins2" );
+    m_resourcePath.push_back( (string)config_GetDataDir () + "/skins2" );
+
     return true;
 }
 
@@ -90,10 +98,40 @@ void X11Factory::destroyOSLoop()
     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
+}
+
+void X11Factory::addInTaskBar()
+{
+    // TODO
+}
+
+void X11Factory::removeFromTaskBar()
+{
+    // TODO
+}
 
-OSTimer *X11Factory::createOSTimer( const Callback &rCallback )
+OSTimer *X11Factory::createOSTimer( CmdGeneric &rCmd )
 {
-    return new X11Timer( getIntf(), rCallback );
+    return new X11Timer( getIntf(), rCmd );
 }
 
 
@@ -111,9 +149,9 @@ OSTooltip *X11Factory::createOSTooltip()
 }
 
 
-const string X11Factory::getDirSeparator() const
+OSPopup *X11Factory::createOSPopup()
 {
-    return "/";
+    return new X11Popup( getIntf(), *m_pDisplay );
 }
 
 
@@ -133,10 +171,10 @@ int X11Factory::getScreenHeight() const
 }
 
 
-Rect X11Factory::getWorkArea() const
+SkinsRect X11Factory::getWorkArea() const
 {
     // XXX
-    return Rect( 0, 0, getScreenWidth(), getScreenHeight() );
+    return SkinsRect( 0, 0, getScreenWidth(), getScreenHeight() );
 }