Commit e0114a72 authored by Erwan Tulou's avatar Erwan Tulou

skins2: new fullscreen implementation (currently intended for Linux)

parent 2e49a0b3
......@@ -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() )
{
......
......@@ -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
......
......@@ -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; }
......
......@@ -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();
}
}
......
......@@ -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();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment