[vlc-devel] commit: skins2: new fullscreen implementation (currently intended for Linux ) (Erwan Tulou )

git version control git at videolan.org
Tue Dec 15 18:10:54 CET 2009


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Tue Dec 15 09:32:31 2009 +0100| [e0114a7255c38c000f3018b2dc1518ce4601816c] | committer: Erwan Tulou 

skins2: new fullscreen implementation (currently intended for Linux)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e0114a7255c38c000f3018b2dc1518ce4601816c
---

 modules/gui/skins2/controls/ctrl_video.cpp |   17 ++++++++++++++++-
 modules/gui/skins2/src/vlcproc.cpp         |    5 +++++
 modules/gui/skins2/src/vlcproc.hpp         |    4 ++++
 modules/gui/skins2/src/vout_manager.cpp    |   28 +++++++++++++++++-----------
 modules/gui/skins2/src/vout_window.cpp     |    6 ++++--
 5 files changed, 46 insertions(+), 14 deletions(-)

diff --git a/modules/gui/skins2/controls/ctrl_video.cpp b/modules/gui/skins2/controls/ctrl_video.cpp
index cd346c0..3fe0fd8 100644
--- a/modules/gui/skins2/controls/ctrl_video.cpp
+++ b/modules/gui/skins2/controls/ctrl_video.cpp
@@ -45,6 +45,9 @@ CtrlVideo::CtrlVideo( intf_thread_t *pIntf, GenericLayout &rLayout,
         VarBox &rVoutSize = VlcProc::instance( pIntf )->getVoutSizeVar();
         rVoutSize.addObserver( this );
     }
+
+    VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
+    rFullscreen.addObserver( this );
 }
 
 
@@ -53,6 +56,9 @@ CtrlVideo::~CtrlVideo()
     VarBox &rVoutSize = VlcProc::instance( getIntf() )->getVoutSizeVar();
     rVoutSize.delObserver( this );
 
+    VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
+    rFullscreen.delObserver( this );
+
     //m_pLayout->getActiveVar().delObserver( this );
 }
 
@@ -167,7 +173,16 @@ void CtrlVideo::onUpdate( Subject<VarBool> &rVariable, void *arg  )
                       m_pLayout->getActiveVar().get() );
     }
 
-    m_bIsUseable = isVisible() && m_pLayout->getActiveVar().get();
+    VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
+    if( &rVariable == &rFullscreen )
+    {
+        msg_Dbg( getIntf(), "VideoCtrl : fullscreen toggled (fullscreen = %d)",
+                      rFullscreen.get() );
+    }
+
+    m_bIsUseable = isVisible() &&
+                   m_pLayout->getActiveVar().get() &&
+                   !rFullscreen.get();
 
     if( m_bIsUseable && !isUsed() )
     {
diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp
index c8dacf7..daf6d96 100644
--- a/modules/gui/skins2/src/vlcproc.cpp
+++ b/modules/gui/skins2/src/vlcproc.cpp
@@ -770,6 +770,11 @@ void VlcProc::update_equalizer()
     SET_BOOL( m_cVarEqualizer, b_equalizer );
 }
 
+void VlcProc::setFullscreenVar( bool b_fullscreen )
+{
+    SET_BOOL( m_cVarFullscreen, b_fullscreen );
+}
+
 #undef  SET_BOOL
 #undef  SET_STREAMTIME
 #undef  SET_TEXT
diff --git a/modules/gui/skins2/src/vlcproc.hpp b/modules/gui/skins2/src/vlcproc.hpp
index fd4caa4..ff849d2 100644
--- a/modules/gui/skins2/src/vlcproc.hpp
+++ b/modules/gui/skins2/src/vlcproc.hpp
@@ -84,6 +84,10 @@ public:
     /// Getter for the vout size variable
     VarBox &getVoutSizeVar() { return m_varVoutSize; }
 
+    /// Getter/Setter for the fullscreen variable
+    VarBool &getFullscreenVar() { return *((VarBool*)(m_cVarFullscreen.get())); }
+    void setFullscreenVar( bool );
+
     /// Indicate whether the embedded video output is currently used
     bool isVoutUsed() const { return m_pVout != NULL; }
 
diff --git a/modules/gui/skins2/src/vout_manager.cpp b/modules/gui/skins2/src/vout_manager.cpp
index 12cbf17..3ff078d 100644
--- a/modules/gui/skins2/src/vout_manager.cpp
+++ b/modules/gui/skins2/src/vout_manager.cpp
@@ -60,6 +60,13 @@ VoutManager::VoutManager( intf_thread_t *pIntf ): SkinObject( pIntf ),
      m_pCtrlVideoVecBackup(), m_SavedWndVec()
 {
     m_pVoutMainWindow = new VoutMainWindow( getIntf() );
+
+    OSFactory *pOsFactory = OSFactory::instance( getIntf() );
+    int width = pOsFactory->getScreenWidth();
+    int height = pOsFactory->getScreenHeight();
+
+    m_pVoutMainWindow->move( 0, 0 );
+    m_pVoutMainWindow->resize( width, height );
 }
 
 
@@ -256,19 +263,18 @@ void VoutManager::setSizeWnd( vout_window_t *pWnd, int width, int height )
 
 void VoutManager::setFullscreenWnd( vout_window_t *pWnd, bool b_fullscreen )
 {
-   msg_Dbg( pWnd, "setFullscreen (%d) received from vout thread",
-                   b_fullscreen ? 1 : 0 );
+    msg_Dbg( pWnd, "setFullscreen (%d) received from vout thread",
+                    b_fullscreen ? 1 : 0 );
 
-   vector<SavedWnd>::iterator it;
-   for( it = m_SavedWndVec.begin(); it != m_SavedWndVec.end(); it++ )
-   {
-       if( (*it).pWnd == pWnd )
-       {
-           VoutWindow* pVoutWindow = (*it).pVoutWindow;
+    VlcProc::instance( getIntf() )->setFullscreenVar( b_fullscreen );
 
-           pVoutWindow->setFullscreen( b_fullscreen );
-           break;
-       }
+    if( b_fullscreen )
+    {
+        m_pVoutMainWindow->show();
+    }
+    else
+    {
+        m_pVoutMainWindow->hide();
     }
 }
 
diff --git a/modules/gui/skins2/src/vout_window.cpp b/modules/gui/skins2/src/vout_window.cpp
index 0bb5235..fab916b 100644
--- a/modules/gui/skins2/src/vout_window.cpp
+++ b/modules/gui/skins2/src/vout_window.cpp
@@ -77,9 +77,11 @@ void VoutWindow::setCtrlVideo( CtrlVideo* pCtrlVideo )
     }
     else
     {
-        hide();
+        int w = VoutManager::instance( getIntf() )->getVoutMainWindow()->getWidth();
+        int h = VoutManager::instance( getIntf() )->getVoutMainWindow()->getHeight();
+
         setParent( VoutManager::instance( getIntf() )->getVoutMainWindow(),
-                   0, 0, 0, 0 );
+                   0, 0, w, h );
         m_pParentWindow =
                   VoutManager::instance( getIntf() )->getVoutMainWindow();
     }




More information about the vlc-devel mailing list