Commit 78b01836 authored by Olivier Teulière's avatar Olivier Teulière

* skins2/src/window_manager.cpp: Added the vlc.isOnTop boolean variable

 * skins2/parser/interpreter.cpp: Renamed vlc.ontop() into vlc.onTop()
 * doc/skins/skins2-howto.xml: doc updated
parent 0112e524
...@@ -714,7 +714,7 @@ difficulty to understand how VLC skins work.</para> ...@@ -714,7 +714,7 @@ difficulty to understand how VLC skins work.</para>
</para></listitem> </para></listitem>
<!-- TODO: Enable it for 0.7.3 <!-- TODO: Enable it for 0.7.3
<listitem><para> <listitem><para>
<emphasis>vlc.ontop()</emphasis>: Toggle the "Always on top" status. <emphasis>vlc.onTop()</emphasis>: Toggle the "Always on top" status.
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
<emphasis>vlc.minimize()</emphasis>: Minimize VLC. <emphasis>vlc.minimize()</emphasis>: Minimize VLC.
...@@ -825,6 +825,11 @@ difficulty to understand how VLC skins work.</para> ...@@ -825,6 +825,11 @@ difficulty to understand how VLC skins work.</para>
<listitem><para> <listitem><para>
<emphasis>vlc.isMute</emphasis>: True when the sound is mute (in VLC, not on your OS), false otherwise. <emphasis>vlc.isMute</emphasis>: True when the sound is mute (in VLC, not on your OS), false otherwise.
</para></listitem> </para></listitem>
<!-- TODO: Enable it for 0.7.3
<listitem><para>
<emphasis>vlc.isOnTop</emphasis>: True when the windows have the "Always on top" status.
</para></listitem>
-->
<listitem><para> <listitem><para>
<emphasis>playlist.isRandom</emphasis>: True when the playlist items are played in a random order, false otherwise. <emphasis>playlist.isRandom</emphasis>: True when the playlist items are played in a random order, false otherwise.
</para></listitem> </para></listitem>
......
...@@ -82,7 +82,7 @@ Interpreter::Interpreter( intf_thread_t *pIntf ): SkinObject( pIntf ) ...@@ -82,7 +82,7 @@ Interpreter::Interpreter( intf_thread_t *pIntf ): SkinObject( pIntf )
REGISTER_CMD( "vlc.slower()", CmdSlower ) REGISTER_CMD( "vlc.slower()", CmdSlower )
REGISTER_CMD( "vlc.mute()", CmdMute ) REGISTER_CMD( "vlc.mute()", CmdMute )
REGISTER_CMD( "vlc.minimize()", CmdMinimize ) REGISTER_CMD( "vlc.minimize()", CmdMinimize )
REGISTER_CMD( "vlc.ontop()", CmdOnTop ) REGISTER_CMD( "vlc.onTop()", CmdOnTop )
REGISTER_CMD( "vlc.quit()", CmdQuit ) REGISTER_CMD( "vlc.quit()", CmdQuit )
// Register the constant bool variables in the var manager // Register the constant bool variables in the var manager
......
...@@ -57,21 +57,6 @@ class VlcProc: public SkinObject ...@@ -57,21 +57,6 @@ class VlcProc: public SkinObject
/// Getter for the stream variable /// Getter for the stream variable
Stream &getStreamVar() { return *((Stream*)(m_cVarStream.get())); } Stream &getStreamVar() { return *((Stream*)(m_cVarStream.get())); }
/// Getter for the mute variable
VarBool &getIsMuteVar() { return *((VarBool*)(m_cVarMute.get())); }
/// Getter for the playing variable
VarBool &getIsPlayingVar() { return *((VarBool*)(m_cVarPlaying.get())); }
/// Getter for the stopped variable
VarBool &getIsStoppedVar() { return *((VarBool*)(m_cVarStopped.get())); }
/// Getter for the paused variable
VarBool &getIsPausedVar() { return *((VarBool*)(m_cVarPaused.get())); }
/// Getter for the seekable variable
VarBool &getIsSeekableVar() { return *((VarBool*)(m_cVarSeekable.get())); }
/// Set the vout window handle /// Set the vout window handle
void setVoutWindow( void *pVoutWindow ); void setVoutWindow( void *pVoutWindow );
......
...@@ -29,11 +29,16 @@ ...@@ -29,11 +29,16 @@
#include "anchor.hpp" #include "anchor.hpp"
#include "tooltip.hpp" #include "tooltip.hpp"
#include "../utils/position.hpp" #include "../utils/position.hpp"
#include "../src/var_manager.hpp"
WindowManager::WindowManager( intf_thread_t *pIntf ): WindowManager::WindowManager( intf_thread_t *pIntf ):
SkinObject( pIntf ), m_isOnTop( false ), m_magnet( 0 ), m_pTooltip( NULL ) SkinObject( pIntf ), m_magnet( 0 ), m_pTooltip( NULL )
{ {
// Create and register a variable for the "on top" status
VarManager *pVarManager = VarManager::instance( getIntf() );
m_cVarOnTop = VariablePtr( new VarBoolImpl( getIntf() ) );
pVarManager->registerVar( m_cVarOnTop, "vlc.isOnTop" );
} }
...@@ -203,11 +208,15 @@ void WindowManager::hideAll() const ...@@ -203,11 +208,15 @@ void WindowManager::hideAll() const
void WindowManager::toggleOnTop() void WindowManager::toggleOnTop()
{ {
m_isOnTop = !m_isOnTop; // Update the boolean variable
VarBoolImpl *pVarOnTop = (VarBoolImpl*)m_cVarOnTop.get();
pVarOnTop->set( !pVarOnTop->get() );
// Toggle the "on top" status
WinSet_t::const_iterator it; WinSet_t::const_iterator it;
for( it = m_allWindows.begin(); it != m_allWindows.end(); it++ ) for( it = m_allWindows.begin(); it != m_allWindows.end(); it++ )
{ {
(*it)->toggleOnTop( m_isOnTop ); (*it)->toggleOnTop( pVarOnTop->get() );
} }
} }
......
...@@ -130,7 +130,7 @@ class WindowManager: public SkinObject ...@@ -130,7 +130,7 @@ class WindowManager: public SkinObject
/// move. /// move.
WinSet_t m_movingWindows; WinSet_t m_movingWindows;
/// Indicate whether the windows are currently on top /// Indicate whether the windows are currently on top
bool m_isOnTop; VariablePtr m_cVarOnTop;
/// Magnetism of the screen edges (= scope of action) /// Magnetism of the screen edges (= scope of action)
int m_magnet; int m_magnet;
/// Alpha value of the static windows /// Alpha value of the static windows
......
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