Commit 5bccf0fd authored by Erwan Tulou's avatar Erwan Tulou Committed by Jean-Baptiste Kempf

skins2: implement VOUT_WINDOW_HIDE_MOUSE control

(cherry picked from commit 93b9f3a3)
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 4f07b523
......@@ -66,3 +66,12 @@ void CmdSetFullscreen::execute()
}
CmdHideMouse::CmdHideMouse( intf_thread_t *pIntf,
vout_window_t * pWnd, bool hide )
: CmdGeneric( pIntf ), m_pWnd( pWnd ), m_bHide( hide ) { }
void CmdHideMouse::execute()
{
getIntf()->p_sys->p_voutManager->hideMouseWnd( m_pWnd, m_bHide );
}
......@@ -84,4 +84,19 @@ private:
bool m_bFullscreen;
};
/// Command to hide mouse
class CmdHideMouse: public CmdGeneric
{
public:
/// hide the mouse
CmdHideMouse( intf_thread_t *pIntf, vout_window_t* pWnd, bool hide );
virtual ~CmdHideMouse() { }
virtual void execute();
virtual std::string getType() const { return "hide mouse"; }
private:
vout_window_t* m_pWnd;
bool m_bHide;
};
#endif
......@@ -51,7 +51,8 @@ public:
kResizeNS,
kResizeWE,
kResizeNWSE,
kResizeNESW
kResizeNESW,
kNoCursor,
};
/**
......
......@@ -472,6 +472,16 @@ static int WindowControl( vout_window_t *pWnd, int query, va_list args )
return VLC_SUCCESS;
}
case VOUT_WINDOW_HIDE_MOUSE:
{
bool hide = va_arg( args, int );
// Post a HideMouse command
CmdHideMouse* pCmd =
new CmdHideMouse( pIntf, pWnd, hide );
pQueue->push( CmdGenericPtr( pCmd ) );
return VLC_SUCCESS;
}
default:
msg_Dbg( pIntf, "control query not supported" );
return VLC_EGENERIC;
......
......@@ -297,6 +297,17 @@ void VoutManager::setFullscreenWnd( vout_window_t *pWnd, bool b_fullscreen )
}
void VoutManager::hideMouseWnd( vout_window_t *pWnd, bool hide )
{
msg_Dbg( pWnd, "hide mouse (%i) received from vout thread", hide );
OSFactory *pOsFactory = OSFactory::instance( getIntf() );
if( hide )
pOsFactory->changeCursor( OSFactory::kNoCursor );
else
pOsFactory->changeCursor( OSFactory::kDefaultArrow );
}
void VoutManager::onUpdate( Subject<VarBool> &rVariable, void *arg )
{
(void)arg;
......
......@@ -118,6 +118,9 @@ public:
/// set fullscreen mode (vout window provider)
void setFullscreenWnd( vout_window_t* pWnd, bool b_fullscreen );
/// hide mouse (vout window provider)
void hideMouseWnd( vout_window_t* pWnd, bool hide );
// Register Video Controls (when building theme)
void registerCtrlVideo( CtrlVideo* p_CtrlVideo );
......
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