Commit a2ce62f8 authored by Cyril Deguet's avatar Cyril Deguet

* controls/*, src/generic_window.cpp, src/generic_layout.cpp: a visibiliy

variable is now owned by CtrlGeneric, and handled directly by the layout
and the window (at the moment only the slider control uses it)
* theme/skin.dtd, parser/builder.cpp, parser, skin_parser.cpp: added
the "color" attribute for control text
parent 0925e59b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_button.cpp * ctrl_button.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_button.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_button.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -33,9 +33,10 @@ ...@@ -33,9 +33,10 @@
CtrlButton::CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp, CtrlButton::CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp,
const GenericBitmap &rBmpOver, const GenericBitmap &rBmpOver,
const GenericBitmap &rBmpDown, CmdGeneric &rCommand, const GenericBitmap &rBmpDown, CmdGeneric &rCommand,
const UString &rTooltip, const UString &rHelp ): const UString &rTooltip, const UString &rHelp,
CtrlGeneric( pIntf, rHelp ), m_fsm( pIntf ), m_rCommand( rCommand ), VarBool *pVisible ):
m_tooltip( rTooltip ), CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ),
m_rCommand( rCommand ), m_tooltip( rTooltip ),
m_cmdUpOverDownOver( this, &transUpOverDownOver ), m_cmdUpOverDownOver( this, &transUpOverDownOver ),
m_cmdDownOverUpOver( this, &transDownOverUpOver ), m_cmdDownOverUpOver( this, &transDownOverUpOver ),
m_cmdDownOverDown( this, &transDownOverDown ), m_cmdDownOverDown( this, &transDownOverDown ),
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_button.hpp * ctrl_button.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_button.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_button.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -42,7 +42,7 @@ class CtrlButton: public CtrlGeneric ...@@ -42,7 +42,7 @@ class CtrlButton: public CtrlGeneric
const GenericBitmap &rBmpOver, const GenericBitmap &rBmpOver,
const GenericBitmap &rBmpDown, const GenericBitmap &rBmpDown,
CmdGeneric &rCommand, const UString &rTooltip, CmdGeneric &rCommand, const UString &rTooltip,
const UString &rHelp ); const UString &rHelp, VarBool *pVisible );
virtual ~CtrlButton(); virtual ~CtrlButton();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_checkbox.cpp * ctrl_checkbox.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_checkbox.cpp,v 1.2 2004/01/18 19:54:46 asmax Exp $ * $Id: ctrl_checkbox.cpp,v 1.3 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -41,8 +41,10 @@ CtrlCheckbox::CtrlCheckbox( intf_thread_t *pIntf, ...@@ -41,8 +41,10 @@ CtrlCheckbox::CtrlCheckbox( intf_thread_t *pIntf,
CmdGeneric &rCommand1, CmdGeneric &rCommand2, CmdGeneric &rCommand1, CmdGeneric &rCommand2,
const UString &rTooltip1, const UString &rTooltip1,
const UString &rTooltip2, const UString &rTooltip2,
VarBool &rVariable, const UString &rHelp ): VarBool &rVariable, const UString &rHelp,
CtrlGeneric( pIntf, rHelp ), m_fsm( pIntf ), m_rVariable( rVariable ), VarBool *pVisible ):
CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ),
m_rVariable( rVariable ),
m_rCommand1( rCommand1 ), m_rCommand2( rCommand2 ), m_rCommand1( rCommand1 ), m_rCommand2( rCommand2 ),
m_tooltip1( rTooltip1 ), m_tooltip2( rTooltip2 ), m_tooltip1( rTooltip1 ), m_tooltip2( rTooltip2 ),
m_cmdUpOverDownOver( this, &transUpOverDownOver ), m_cmdUpOverDownOver( this, &transUpOverDownOver ),
...@@ -247,7 +249,7 @@ void CtrlCheckbox::transHiddenUp( SkinObject *pCtrl ) ...@@ -247,7 +249,7 @@ void CtrlCheckbox::transHiddenUp( SkinObject *pCtrl )
} }
void CtrlCheckbox::onUpdate( Subject<VarBool> &rVariable ) void CtrlCheckbox::onVarBoolUpdate( VarBool &rVariable )
{ {
changeButton(); changeButton();
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_checkbox.hpp * ctrl_checkbox.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_checkbox.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_checkbox.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -32,11 +32,10 @@ ...@@ -32,11 +32,10 @@
class GenericBitmap; class GenericBitmap;
class OSGraphics; class OSGraphics;
class CmdGeneric; class CmdGeneric;
class VarBool;
/// Base class for checkbox controls /// Base class for checkbox controls
class CtrlCheckbox: public CtrlGeneric, public Observer<VarBool> class CtrlCheckbox: public CtrlGeneric
{ {
public: public:
/// Create a checkbox with 6 images /// Create a checkbox with 6 images
...@@ -49,7 +48,8 @@ class CtrlCheckbox: public CtrlGeneric, public Observer<VarBool> ...@@ -49,7 +48,8 @@ class CtrlCheckbox: public CtrlGeneric, public Observer<VarBool>
const GenericBitmap &rBmpDown2, const GenericBitmap &rBmpDown2,
CmdGeneric &rCommand1, CmdGeneric &rCommand2, CmdGeneric &rCommand1, CmdGeneric &rCommand2,
const UString &rTooltip1, const UString &rTooltip2, const UString &rTooltip1, const UString &rTooltip2,
VarBool &rVariable, const UString &rHelp ); VarBool &rVariable, const UString &rHelp,
VarBool *pVisible);
virtual ~CtrlCheckbox(); virtual ~CtrlCheckbox();
...@@ -112,7 +112,7 @@ class CtrlCheckbox: public CtrlGeneric, public Observer<VarBool> ...@@ -112,7 +112,7 @@ class CtrlCheckbox: public CtrlGeneric, public Observer<VarBool>
static void transHiddenUp( SkinObject *pCtrl ); static void transHiddenUp( SkinObject *pCtrl );
/// Method called when the observed variable is modified /// Method called when the observed variable is modified
virtual void onUpdate( Subject<VarBool> &rVariable ); virtual void onVarBoolUpdate( VarBool &rVariable );
/// Helper function to update the current state of images /// Helper function to update the current state of images
void changeButton(); void changeButton();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_flat.hpp * ctrl_flat.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_flat.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_flat.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -32,8 +32,10 @@ ...@@ -32,8 +32,10 @@
class CtrlFlat: public CtrlGeneric class CtrlFlat: public CtrlGeneric
{ {
protected: protected:
CtrlFlat( intf_thread_t *pIntf, const UString &rHelp ): CtrlFlat( intf_thread_t *pIntf, const UString &rHelp,
CtrlGeneric( pIntf, rHelp ) {} VarBool *pVisible ):
CtrlGeneric( pIntf, rHelp, pVisible ) {}
virtual ~CtrlFlat() {} virtual ~CtrlFlat() {}
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_generic.cpp * ctrl_generic.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_generic.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_generic.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -27,12 +27,19 @@ ...@@ -27,12 +27,19 @@
#include "../src/generic_window.hpp" #include "../src/generic_window.hpp"
#include "../src/os_graphics.hpp" #include "../src/os_graphics.hpp"
#include "../utils/position.hpp" #include "../utils/position.hpp"
#include "../utils/var_bool.hpp"
CtrlGeneric::CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp ): CtrlGeneric::CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp,
VarBool *pVisible):
SkinObject( pIntf ), m_pLayout( NULL ), m_pPosition( NULL ), SkinObject( pIntf ), m_pLayout( NULL ), m_pPosition( NULL ),
m_help( rHelp ) m_help( rHelp ), m_pVisible( pVisible )
{ {
// Observe the visibility variable
if( m_pVisible )
{
m_pVisible->addObserver( this );
}
} }
...@@ -42,6 +49,10 @@ CtrlGeneric::~CtrlGeneric() ...@@ -42,6 +49,10 @@ CtrlGeneric::~CtrlGeneric()
{ {
delete m_pPosition; delete m_pPosition;
} }
if( m_pVisible )
{
m_pVisible->delObserver( this );
}
} }
...@@ -108,3 +119,25 @@ GenericWindow *CtrlGeneric::getWindow() const ...@@ -108,3 +119,25 @@ GenericWindow *CtrlGeneric::getWindow() const
return NULL; return NULL;
} }
bool CtrlGeneric::isVisible() const
{
return !m_pVisible || m_pVisible->get();
}
void CtrlGeneric::onUpdate( Subject<VarBool> &rVariable )
{
// Is it the visibily variable ?
if( &rVariable == m_pVisible )
{
// Redraw the layout
notifyLayout();
}
else
{
// Call the user-defined callback
onVarBoolUpdate( (VarBool&)rVariable );
}
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_generic.hpp * ctrl_generic.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_generic.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_generic.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr>
...@@ -29,16 +29,18 @@ ...@@ -29,16 +29,18 @@
#include "../utils/pointer.hpp" #include "../utils/pointer.hpp"
#include "../utils/fsm.hpp" #include "../utils/fsm.hpp"
#include "../utils/ustring.hpp" #include "../utils/ustring.hpp"
#include "../utils/observer.hpp"
class EvtGeneric; class EvtGeneric;
class OSGraphics; class OSGraphics;
class GenericLayout; class GenericLayout;
class Position; class Position;
class GenericWindow; class GenericWindow;
class VarBool;
/// Base class for controls /// Base class for controls
class CtrlGeneric: public SkinObject class CtrlGeneric: public SkinObject, public Observer<VarBool>
{ {
public: public:
virtual ~CtrlGeneric(); virtual ~CtrlGeneric();
...@@ -73,8 +75,13 @@ class CtrlGeneric: public SkinObject ...@@ -73,8 +75,13 @@ class CtrlGeneric: public SkinObject
/// Return true if the control can gain the focus /// Return true if the control can gain the focus
virtual bool isFocusable() const { return false; } virtual bool isFocusable() const { return false; }
/// Return true if the control is visible
virtual bool isVisible() const;
protected: protected:
CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp ); // If pVisible is NULL, the control is always visible
CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp,
VarBool *pVisible = NULL );
/// Tell the layout when the image has changed /// Tell the layout when the image has changed
virtual void notifyLayout() const; virtual void notifyLayout() const;
...@@ -95,6 +102,9 @@ class CtrlGeneric: public SkinObject ...@@ -95,6 +102,9 @@ class CtrlGeneric: public SkinObject
/// the Position object is set /// the Position object is set
virtual void onPositionChange() {} virtual void onPositionChange() {}
/// Overload this method to get notified of bool variable changes
virtual void onVarBoolUpdate( VarBool &rVar ) {}
private: private:
/// Associated layout /// Associated layout
GenericLayout *m_pLayout; GenericLayout *m_pLayout;
...@@ -102,6 +112,11 @@ class CtrlGeneric: public SkinObject ...@@ -102,6 +112,11 @@ class CtrlGeneric: public SkinObject
Position *m_pPosition; Position *m_pPosition;
/// Help text /// Help text
UString m_help; UString m_help;
/// Visibilty variable
VarBool *m_pVisible;
/// Method called when an observed bool variable is changed
virtual void onUpdate( Subject<VarBool> &rVariable );
}; };
typedef CountedPtr<CtrlGeneric> CtrlGenericPtr; typedef CountedPtr<CtrlGeneric> CtrlGenericPtr;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_image.cpp * ctrl_image.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_image.cpp,v 1.2 2004/02/01 14:44:11 asmax Exp $ * $Id: ctrl_image.cpp,v 1.3 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
CtrlImage::CtrlImage( intf_thread_t *pIntf, const GenericBitmap &rBitmap, CtrlImage::CtrlImage( intf_thread_t *pIntf, const GenericBitmap &rBitmap,
const UString &rHelp ): const UString &rHelp, VarBool *pVisible ):
CtrlFlat( pIntf, rHelp ), m_rBitmap( rBitmap ) CtrlFlat( pIntf, rHelp, pVisible ), m_rBitmap( rBitmap )
{ {
OSFactory *pOsFactory = OSFactory::instance( pIntf ); OSFactory *pOsFactory = OSFactory::instance( pIntf );
// Create an initial unscaled image in the buffer // Create an initial unscaled image in the buffer
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_image.hpp * ctrl_image.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_image.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_image.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -38,7 +38,7 @@ class CtrlImage: public CtrlFlat ...@@ -38,7 +38,7 @@ class CtrlImage: public CtrlFlat
public: public:
// Create an image with the given bitmap (which is NOT copied) // Create an image with the given bitmap (which is NOT copied)
CtrlImage( intf_thread_t *pIntf, const GenericBitmap &rBitmap, CtrlImage( intf_thread_t *pIntf, const GenericBitmap &rBitmap,
const UString &rHelp ); const UString &rHelp, VarBool *pVisible );
virtual ~CtrlImage(); virtual ~CtrlImage();
/// Handle an event on the control /// Handle an event on the control
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_list.cpp * ctrl_list.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_list.cpp,v 1.2 2004/02/27 13:24:12 gbazin Exp $ * $Id: ctrl_list.cpp,v 1.3 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -41,8 +41,8 @@ ...@@ -41,8 +41,8 @@
CtrlList::CtrlList( intf_thread_t *pIntf, VarList &rList, GenericFont &rFont, CtrlList::CtrlList( intf_thread_t *pIntf, VarList &rList, GenericFont &rFont,
uint32_t fgColor, uint32_t playColor, uint32_t bgColor1, uint32_t fgColor, uint32_t playColor, uint32_t bgColor1,
uint32_t bgColor2, uint32_t selColor, uint32_t bgColor2, uint32_t selColor,
const UString &rHelp ): const UString &rHelp, VarBool *pVisible ):
CtrlGeneric( pIntf, rHelp ), m_rList( rList ), m_rFont( rFont ), CtrlGeneric( pIntf, rHelp, pVisible ), m_rList( rList ), m_rFont( rFont ),
m_fgColor( fgColor ), m_playColor( playColor ), m_bgColor1( bgColor1 ), m_fgColor( fgColor ), m_playColor( playColor ), m_bgColor1( bgColor1 ),
m_bgColor2( bgColor2 ), m_selColor( selColor ), m_pLastSelected( NULL ), m_bgColor2( bgColor2 ), m_selColor( selColor ), m_pLastSelected( NULL ),
m_pImage( NULL ), m_lastPos( 0 ) m_pImage( NULL ), m_lastPos( 0 )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_list.hpp * ctrl_list.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_list.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_list.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr>
...@@ -41,7 +41,7 @@ class CtrlList: public CtrlGeneric, public Observer<VarList>, ...@@ -41,7 +41,7 @@ class CtrlList: public CtrlGeneric, public Observer<VarList>,
CtrlList( intf_thread_t *pIntf, VarList &rList, GenericFont &rFont, CtrlList( intf_thread_t *pIntf, VarList &rList, GenericFont &rFont,
uint32_t fgcolor, uint32_t playcolor, uint32_t bgcolor1, uint32_t fgcolor, uint32_t playcolor, uint32_t bgcolor1,
uint32_t bgcolor2, uint32_t selColor, uint32_t bgcolor2, uint32_t selColor,
const UString &rHelp ); const UString &rHelp, VarBool *pVisible );
virtual ~CtrlList(); virtual ~CtrlList();
/// Handle an event on the control. /// Handle an event on the control.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_move.cpp * ctrl_move.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_move.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_move.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
CtrlMove::CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager, CtrlMove::CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager,
CtrlFlat &rCtrl, GenericWindow &rWindow, CtrlFlat &rCtrl, GenericWindow &rWindow,
const UString &rHelp ): const UString &rHelp, VarBool *pVisible ):
CtrlFlat( pIntf, rHelp ), m_fsm( pIntf ), CtrlFlat( pIntf, rHelp, pVisible ), m_fsm( pIntf ),
m_rWindowManager( rWindowManager ), m_rWindowManager( rWindowManager ),
m_rCtrl( rCtrl ), m_rWindow( rWindow ), m_rCtrl( rCtrl ), m_rWindow( rWindow ),
m_cmdMovingMoving( this, &transMovingMoving ), m_cmdMovingMoving( this, &transMovingMoving ),
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_move.hpp * ctrl_move.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_move.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_move.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -39,7 +39,7 @@ class CtrlMove: public CtrlFlat ...@@ -39,7 +39,7 @@ class CtrlMove: public CtrlFlat
public: public:
CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager, CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager,
CtrlFlat &rCtrl, GenericWindow &rWindow, CtrlFlat &rCtrl, GenericWindow &rWindow,
const UString &rHelp ); const UString &rHelp, VarBool *pVisible );
virtual ~CtrlMove() {} virtual ~CtrlMove() {}
/// Handle an event /// Handle an event
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_radialslider.cpp * ctrl_radialslider.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_radialslider.cpp,v 1.2 2004/01/11 17:12:17 asmax Exp $ * $Id: ctrl_radialslider.cpp,v 1.3 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -36,8 +36,9 @@ ...@@ -36,8 +36,9 @@
CtrlRadialSlider::CtrlRadialSlider( intf_thread_t *pIntf, CtrlRadialSlider::CtrlRadialSlider( intf_thread_t *pIntf,
const GenericBitmap &rBmpSeq, int numImg, const GenericBitmap &rBmpSeq, int numImg,
VarPercent &rVariable, float minAngle, VarPercent &rVariable, float minAngle,
float maxAngle, const UString &rHelp ): float maxAngle, const UString &rHelp,
CtrlGeneric( pIntf, rHelp ), m_fsm( pIntf ), m_numImg( numImg ), VarBool *pVisible ):
CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ), m_numImg( numImg ),
m_rVariable( rVariable ), m_minAngle( minAngle ), m_maxAngle( maxAngle ), m_rVariable( rVariable ), m_minAngle( minAngle ), m_maxAngle( maxAngle ),
m_cmdUpDown( this, &transUpDown ), m_cmdDownUp( this, &transDownUp ), m_cmdUpDown( this, &transUpDown ), m_cmdDownUp( this, &transDownUp ),
m_cmdMove( this, &transMove ), m_position( 0 ), m_lastPos( 0 ) m_cmdMove( this, &transMove ), m_position( 0 ), m_lastPos( 0 )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_radialslider.hpp * ctrl_radialslider.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_radialslider.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $ * $Id: ctrl_radialslider.hpp,v 1.3 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr>
...@@ -43,7 +43,8 @@ class CtrlRadialSlider: public CtrlGeneric, public Observer<VarPercent> ...@@ -43,7 +43,8 @@ class CtrlRadialSlider: public CtrlGeneric, public Observer<VarPercent>
/// composed of numImg subimages of the same size /// composed of numImg subimages of the same size
CtrlRadialSlider( intf_thread_t *pIntf, const GenericBitmap &rBmpSeq, CtrlRadialSlider( intf_thread_t *pIntf, const GenericBitmap &rBmpSeq,
int numImg, VarPercent &rVariable, float minAngle, int numImg, VarPercent &rVariable, float minAngle,
float maxAngle, const UString &rHelp ); float maxAngle, const UString &rHelp,
VarBool *pVisible );
virtual ~CtrlRadialSlider(); virtual ~CtrlRadialSlider();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_resize.cpp * ctrl_resize.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_resize.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_resize.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -33,8 +33,9 @@ ...@@ -33,8 +33,9 @@
CtrlResize::CtrlResize( intf_thread_t *pIntf, CtrlFlat &rCtrl, CtrlResize::CtrlResize( intf_thread_t *pIntf, CtrlFlat &rCtrl,
GenericLayout &rLayout, const UString &rHelp ): GenericLayout &rLayout, const UString &rHelp,
CtrlFlat( pIntf, rHelp ), m_fsm( pIntf ), m_rCtrl( rCtrl ), VarBool *pVisible ):
CtrlFlat( pIntf, rHelp, pVisible ), m_fsm( pIntf ), m_rCtrl( rCtrl ),
m_rLayout( rLayout ), m_cmdResizeResize( this, &transResizeResize ), m_rLayout( rLayout ), m_cmdResizeResize( this, &transResizeResize ),
m_cmdStillResize( this, &transStillResize ), m_cmdStillResize( this, &transStillResize ),
m_cmdResizeStill( this, &transResizeStill ) m_cmdResizeStill( this, &transResizeStill )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_resize.hpp * ctrl_resize.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_resize.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_resize.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr>
...@@ -37,7 +37,8 @@ class CtrlResize: public CtrlFlat ...@@ -37,7 +37,8 @@ class CtrlResize: public CtrlFlat
{ {
public: public:
CtrlResize( intf_thread_t *pIntf, CtrlFlat &rCtrl, CtrlResize( intf_thread_t *pIntf, CtrlFlat &rCtrl,
GenericLayout &rLayout, const UString &rHelp ); GenericLayout &rLayout, const UString &rHelp,
VarBool *pVisible );
virtual ~CtrlResize() {} virtual ~CtrlResize() {}
/// Handle an event /// Handle an event
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_slider.cpp * ctrl_slider.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_slider.cpp,v 1.3 2004/02/01 21:13:04 ipkiss Exp $ * $Id: ctrl_slider.cpp,v 1.4 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -47,8 +47,8 @@ CtrlSliderCursor::CtrlSliderCursor( intf_thread_t *pIntf, ...@@ -47,8 +47,8 @@ CtrlSliderCursor::CtrlSliderCursor( intf_thread_t *pIntf,
VarBool *pVisible, VarBool *pVisible,
const UString &rTooltip, const UString &rTooltip,
const UString &rHelp ): const UString &rHelp ):
CtrlGeneric( pIntf, rHelp ), m_fsm( pIntf ), m_rVariable( rVariable ), CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ),
m_pVisible( pVisible ), m_tooltip( rTooltip ), m_rVariable( rVariable ), m_tooltip( rTooltip ),
m_width( rCurve.getWidth() ), m_height( rCurve.getHeight() ), m_width( rCurve.getWidth() ), m_height( rCurve.getHeight() ),
m_cmdOverDown( this, &transOverDown ), m_cmdOverDown( this, &transOverDown ),
m_cmdDownOver( this, &transDownOver ), m_cmdOverUp( this, &transOverUp ), m_cmdDownOver( this, &transDownOver ), m_cmdOverUp( this, &transOverUp ),
...@@ -91,12 +91,6 @@ CtrlSliderCursor::CtrlSliderCursor( intf_thread_t *pIntf, ...@@ -91,12 +91,6 @@ CtrlSliderCursor::CtrlSliderCursor( intf_thread_t *pIntf,
// Observe the position variable // Observe the position variable
m_rVariable.addObserver( this ); m_rVariable.addObserver( this );
// Observe the visibility variable
if( m_pVisible )
{
m_pVisible->addObserver( this );
}
// Initial position of the cursor // Initial position of the cursor
m_lastPercentage = m_rVariable.get(); m_lastPercentage = m_rVariable.get();
} }
...@@ -105,10 +99,6 @@ CtrlSliderCursor::CtrlSliderCursor( intf_thread_t *pIntf, ...@@ -105,10 +99,6 @@ CtrlSliderCursor::CtrlSliderCursor( intf_thread_t *pIntf,
CtrlSliderCursor::~CtrlSliderCursor() CtrlSliderCursor::~CtrlSliderCursor()
{ {
m_rVariable.delObserver( this ); m_rVariable.delObserver( this );
if( m_pVisible )
{
m_pVisible->delObserver( this );
}
SKINS_DELETE( m_pImgUp ); SKINS_DELETE( m_pImgUp );
SKINS_DELETE( m_pImgDown ); SKINS_DELETE( m_pImgDown );
SKINS_DELETE( m_pImgOver ); SKINS_DELETE( m_pImgOver );
...@@ -150,7 +140,7 @@ bool CtrlSliderCursor::mouseOver( int x, int y ) const ...@@ -150,7 +140,7 @@ bool CtrlSliderCursor::mouseOver( int x, int y ) const
void CtrlSliderCursor::draw( OSGraphics &rImage, int xDest, int yDest ) void CtrlSliderCursor::draw( OSGraphics &rImage, int xDest, int yDest )
{ {
if( m_pImg && (!m_pVisible || m_pVisible->get()) ) if( m_pImg )
{ {
// Compute the position of the cursor // Compute the position of the cursor
int xPos, yPos; int xPos, yPos;
...@@ -177,13 +167,6 @@ void CtrlSliderCursor::onUpdate( Subject<VarPercent> &rVariable ) ...@@ -177,13 +167,6 @@ void CtrlSliderCursor::onUpdate( Subject<VarPercent> &rVariable )
} }
void CtrlSliderCursor::onUpdate( Subject<VarBool> &rVariable )
{
// The visibility variable has changed
notifyLayout();
}
void CtrlSliderCursor::transOverDown( SkinObject *pCtrl ) void CtrlSliderCursor::transOverDown( SkinObject *pCtrl )
{ {
CtrlSliderCursor *pThis = (CtrlSliderCursor*)pCtrl; CtrlSliderCursor *pThis = (CtrlSliderCursor*)pCtrl;
...@@ -320,8 +303,8 @@ CtrlSliderBg::CtrlSliderBg( intf_thread_t *pIntf, CtrlSliderCursor &rCursor, ...@@ -320,8 +303,8 @@ CtrlSliderBg::CtrlSliderBg( intf_thread_t *pIntf, CtrlSliderCursor &rCursor,
const Bezier &rCurve, VarPercent &rVariable, const Bezier &rCurve, VarPercent &rVariable,
int thickness, VarBool *pVisible, int thickness, VarBool *pVisible,
const UString &rHelp ): const UString &rHelp ):
CtrlGeneric( pIntf, rHelp ), m_rCursor( rCursor ), m_rVariable( rVariable ), CtrlGeneric( pIntf, rHelp, pVisible ), m_rCursor( rCursor ),
m_thickness( thickness ), m_pVisible( pVisible ), m_curve( rCurve ), m_rVariable( rVariable ), m_thickness( thickness ), m_curve( rCurve ),
m_width( rCurve.getWidth() ), m_height( rCurve.getHeight() ) m_width( rCurve.getWidth() ), m_height( rCurve.getHeight() )
{ {
} }
...@@ -329,11 +312,6 @@ CtrlSliderBg::CtrlSliderBg( intf_thread_t *pIntf, CtrlSliderCursor &rCursor, ...@@ -329,11 +312,6 @@ CtrlSliderBg::CtrlSliderBg( intf_thread_t *pIntf, CtrlSliderCursor &rCursor,
bool CtrlSliderBg::mouseOver( int x, int y ) const bool CtrlSliderBg::mouseOver( int x, int y ) const
{ {
if( m_pVisible && !m_pVisible->get() )
{
return false;
}
// Compute the resize factors // Compute the resize factors
float factorX, factorY; float factorX, factorY;
getResizeFactors( factorX, factorY ); getResizeFactors( factorX, factorY );
...@@ -392,13 +370,6 @@ void CtrlSliderBg::handleEvent( EvtGeneric &rEvent ) ...@@ -392,13 +370,6 @@ void CtrlSliderBg::handleEvent( EvtGeneric &rEvent )
} }
void CtrlSliderBg::onUpdate( Subject<VarBool> &rVariable )
{
// The visibility variable has changed
notifyLayout();
}
void CtrlSliderBg::getResizeFactors( float &rFactorX, float &rFactorY ) const void CtrlSliderBg::getResizeFactors( float &rFactorX, float &rFactorY ) const
{ {
// Get the position of the control // Get the position of the control
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_slider.hpp * ctrl_slider.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_slider.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $ * $Id: ctrl_slider.hpp,v 1.3 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -34,12 +34,10 @@ ...@@ -34,12 +34,10 @@
class GenericBitmap; class GenericBitmap;
class OSGraphics; class OSGraphics;
class VarPercent; class VarPercent;
class VarBool;
/// Cursor of a slider /// Cursor of a slider
class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>, class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>
public Observer<VarBool>
{ {
public: public:
/// Create a cursor with 3 images (which are NOT copied, be careful) /// Create a cursor with 3 images (which are NOT copied, be careful)
...@@ -70,8 +68,6 @@ class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>, ...@@ -70,8 +68,6 @@ class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>,
FSM m_fsm; FSM m_fsm;
/// Variable associated to the cursor /// Variable associated to the cursor
VarPercent &m_rVariable; VarPercent &m_rVariable;
/// Visibility variable
VarBool *m_pVisible;
/// Tooltip text /// Tooltip text
const UString m_tooltip; const UString m_tooltip;
/// Initial size of the control /// Initial size of the control
...@@ -109,9 +105,6 @@ class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>, ...@@ -109,9 +105,6 @@ class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>,
/// Method called when the position variable is modified /// Method called when the position variable is modified
virtual void onUpdate( Subject<VarPercent> &rVariable ); virtual void onUpdate( Subject<VarPercent> &rVariable );
/// Method called when the visibility variable is modified
virtual void onUpdate( Subject<VarBool> &rVariable );
/// Methode to compute the resize factors /// Methode to compute the resize factors
void getResizeFactors( float &rFactorX, float &rFactorY ) const; void getResizeFactors( float &rFactorX, float &rFactorY ) const;
}; };
...@@ -121,7 +114,6 @@ class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>, ...@@ -121,7 +114,6 @@ class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>,
class CtrlSliderBg: public CtrlGeneric class CtrlSliderBg: public CtrlGeneric
{ {
public: public:
/// If pVisible is NULL, the control is always visible
CtrlSliderBg( intf_thread_t *pIntf, CtrlSliderCursor &rCursor, CtrlSliderBg( intf_thread_t *pIntf, CtrlSliderCursor &rCursor,
const Bezier &rCurve, VarPercent &rVariable, const Bezier &rCurve, VarPercent &rVariable,
int thickness, VarBool *pVisible, const UString &rHelp ); int thickness, VarBool *pVisible, const UString &rHelp );
...@@ -140,8 +132,6 @@ class CtrlSliderBg: public CtrlGeneric ...@@ -140,8 +132,6 @@ class CtrlSliderBg: public CtrlGeneric
VarPercent &m_rVariable; VarPercent &m_rVariable;
/// Thickness of the curve /// Thickness of the curve
int m_thickness; int m_thickness;
/// Visibility variable
VarBool *m_pVisible;
/// Bezier curve of the slider /// Bezier curve of the slider
const Bezier m_curve; const Bezier m_curve;
/// Initial size of the control /// Initial size of the control
...@@ -149,9 +139,6 @@ class CtrlSliderBg: public CtrlGeneric ...@@ -149,9 +139,6 @@ class CtrlSliderBg: public CtrlGeneric
/// Methode to compute the resize factors /// Methode to compute the resize factors
void getResizeFactors( float &rFactorX, float &rFactorY ) const; void getResizeFactors( float &rFactorX, float &rFactorY ) const;
/// Method called when the visibility variable is modified
virtual void onUpdate( Subject<VarBool> &rVariable );
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_text.cpp * ctrl_text.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_text.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_text.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
CtrlText::CtrlText( intf_thread_t *pIntf, VarText &rVariable, CtrlText::CtrlText( intf_thread_t *pIntf, VarText &rVariable,
const GenericFont &rFont, const UString &rHelp, const GenericFont &rFont, const UString &rHelp,
uint32_t color ): uint32_t color, VarBool *pVisible ):
CtrlGeneric( pIntf, rHelp ), m_fsm( pIntf ), m_rVariable( rVariable ), CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ),
m_cmdToManual( this, &transToManual ), m_rVariable( rVariable ), m_cmdToManual( this, &transToManual ),
m_cmdManualMoving( this, &transManualMoving ), m_cmdManualMoving( this, &transManualMoving ),
m_cmdManualStill( this, &transManualStill ), m_cmdManualStill( this, &transManualStill ),
m_cmdMove( this, &transMove ), m_cmdMove( this, &transMove ),
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ctrl_text.hpp * ctrl_text.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: ctrl_text.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: ctrl_text.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr>
...@@ -44,7 +44,7 @@ class CtrlText: public CtrlGeneric, public Observer<VarText> ...@@ -44,7 +44,7 @@ class CtrlText: public CtrlGeneric, public Observer<VarText>
/// Create a text control with the optional given color /// Create a text control with the optional given color
CtrlText( intf_thread_t *pIntf, VarText &rVariable, CtrlText( intf_thread_t *pIntf, VarText &rVariable,
const GenericFont &rFont, const UString &rHelp, const GenericFont &rFont, const UString &rHelp,
uint32_t color = 0 ); uint32_t color, VarBool *pVisible );
virtual ~CtrlText(); virtual ~CtrlText();
/// Handle an event /// Handle an event
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* builder.cpp * builder.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: builder.cpp,v 1.6 2004/02/27 13:24:12 gbazin Exp $ * $Id: builder.cpp,v 1.7 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -216,7 +216,7 @@ void Builder::addButton( const BuilderData::Button &rData ) ...@@ -216,7 +216,7 @@ void Builder::addButton( const BuilderData::Button &rData )
CtrlButton *pButton = new CtrlButton( getIntf(), *pBmpUp, *pBmpOver, CtrlButton *pButton = new CtrlButton( getIntf(), *pBmpUp, *pBmpOver,
*pBmpDown, *pCommand, UString( getIntf(), rData.m_tooltip.c_str() ), *pBmpDown, *pCommand, UString( getIntf(), rData.m_tooltip.c_str() ),
UString( getIntf(), rData.m_help.c_str() ) ); UString( getIntf(), rData.m_help.c_str() ), NULL );
// Compute the position of the control // Compute the position of the control
// XXX (we suppose all the images have the same size...) // XXX (we suppose all the images have the same size...)
...@@ -287,7 +287,7 @@ void Builder::addCheckbox( const BuilderData::Checkbox &rData ) ...@@ -287,7 +287,7 @@ void Builder::addCheckbox( const BuilderData::Checkbox &rData )
*pBmpOver1, *pBmpDown1, *pBmpUp2, *pBmpOver2, *pBmpDown2, *pCommand1, *pBmpOver1, *pBmpDown1, *pBmpUp2, *pBmpOver2, *pBmpDown2, *pCommand1,
*pCommand2, UString( getIntf(), rData.m_tooltip1.c_str() ), *pCommand2, UString( getIntf(), rData.m_tooltip1.c_str() ),
UString( getIntf(), rData.m_tooltip2.c_str() ), *pVar, UString( getIntf(), rData.m_tooltip2.c_str() ), *pVar,
UString( getIntf(), rData.m_help.c_str() ) ); UString( getIntf(), rData.m_help.c_str() ), NULL );
// Compute the position of the control // Compute the position of the control
// XXX (we suppose all the images have the same size...) // XXX (we suppose all the images have the same size...)
...@@ -322,7 +322,8 @@ void Builder::addImage( const BuilderData::Image &rData ) ...@@ -322,7 +322,8 @@ void Builder::addImage( const BuilderData::Image &rData )
} }
CtrlImage *pImage = new CtrlImage( getIntf(), *pBmp, CtrlImage *pImage = new CtrlImage( getIntf(), *pBmp,
UString( getIntf(), rData.m_help.c_str() ) ); UString( getIntf(), rData.m_help.c_str() ),
NULL);
// Compute the position of the control // Compute the position of the control
const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom, const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
...@@ -334,13 +335,14 @@ void Builder::addImage( const BuilderData::Image &rData ) ...@@ -334,13 +335,14 @@ void Builder::addImage( const BuilderData::Image &rData )
if( rData.m_onclickId == "move" ) if( rData.m_onclickId == "move" )
{ {
CtrlMove *pMove = new CtrlMove( getIntf(), m_pTheme->getWindowManager(), CtrlMove *pMove = new CtrlMove( getIntf(), m_pTheme->getWindowManager(),
*pImage, *pWindow, UString( getIntf(), rData.m_help.c_str() ) ); *pImage, *pWindow, UString( getIntf(), rData.m_help.c_str() ),
NULL);
pLayout->addControl( pMove, pos, rData.m_layer ); pLayout->addControl( pMove, pos, rData.m_layer );
} }
else if( rData.m_onclickId == "resize" ) else if( rData.m_onclickId == "resize" )
{ {
CtrlResize *pResize = new CtrlResize( getIntf(), *pImage, *pLayout, CtrlResize *pResize = new CtrlResize( getIntf(), *pImage, *pLayout,
UString( getIntf(), rData.m_help.c_str() ) ); UString( getIntf(), rData.m_help.c_str() ), NULL );
pLayout->addControl( pResize, pos, rData.m_layer ); pLayout->addControl( pResize, pos, rData.m_layer );
} }
else else
...@@ -375,7 +377,7 @@ void Builder::addText( const BuilderData::Text &rData ) ...@@ -375,7 +377,7 @@ void Builder::addText( const BuilderData::Text &rData )
m_pTheme->m_vars.push_back( VariablePtr( pVar ) ); m_pTheme->m_vars.push_back( VariablePtr( pVar ) );
CtrlText *pText = new CtrlText( getIntf(), *pVar, *pFont, CtrlText *pText = new CtrlText( getIntf(), *pVar, *pFont,
UString( getIntf(), rData.m_help.c_str() ) ); UString( getIntf(), rData.m_help.c_str() ), rData.m_color, NULL );
int height = pFont->getSize(); int height = pFont->getSize();
...@@ -414,7 +416,8 @@ void Builder::addRadialSlider( const BuilderData::RadialSlider &rData ) ...@@ -414,7 +416,8 @@ void Builder::addRadialSlider( const BuilderData::RadialSlider &rData )
CtrlRadialSlider *pRadial = CtrlRadialSlider *pRadial =
new CtrlRadialSlider( getIntf(), *pSeq, rData.m_nbImages, *pVar, new CtrlRadialSlider( getIntf(), *pSeq, rData.m_nbImages, *pVar,
rData.m_minAngle, rData.m_maxAngle, rData.m_minAngle, rData.m_maxAngle,
UString( getIntf(), rData.m_help.c_str() ) ); UString( getIntf(), rData.m_help.c_str() ),
NULL );
// XXX: resizing is not supported // XXX: resizing is not supported
// Compute the position of the control // Compute the position of the control
...@@ -524,7 +527,7 @@ void Builder::addList( const BuilderData::List &rData ) ...@@ -524,7 +527,7 @@ void Builder::addList( const BuilderData::List &rData )
CtrlList *pList = new CtrlList( getIntf(), *pVar, *pFont, CtrlList *pList = new CtrlList( getIntf(), *pVar, *pFont,
rData.m_fgColor, rData.m_playColor, rData.m_bgColor1, rData.m_fgColor, rData.m_playColor, rData.m_bgColor1,
rData.m_bgColor2, rData.m_selColor, rData.m_bgColor2, rData.m_selColor,
UString( getIntf(), rData.m_help.c_str() ) ); UString( getIntf(), rData.m_help.c_str() ), NULL );
// Compute the position of the control // Compute the position of the control
const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom, const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
......
...@@ -7,7 +7,7 @@ Anchor xPos:int yPos:int range:int priority:int windowId:string ...@@ -7,7 +7,7 @@ Anchor xPos:int yPos:int range:int priority:int windowId:string
Button id:string xPos:int yPos:int leftTop:string rightBottom:string upId:string downId:string overId:string actionId:string tooltip:string help:string layer:int windowId:string layoutId:string Button id:string xPos:int yPos:int leftTop:string rightBottom:string upId:string downId:string overId:string actionId:string tooltip:string help:string layer:int windowId:string layoutId:string
Checkbox id:string xPos:int yPos:int leftTop:string rightBottom:string up1Id:string down1Id:string over1Id:string up2Id:string down2Id:string over2Id:string state:string action1:string action2:string tooltip1:string tooltip2:string help:string layer:int windowId:string layoutId:string Checkbox id:string xPos:int yPos:int leftTop:string rightBottom:string up1Id:string down1Id:string over1Id:string up2Id:string down2Id:string over2Id:string state:string action1:string action2:string tooltip1:string tooltip2:string help:string layer:int windowId:string layoutId:string
Image id:string xPos:int yPos:int leftTop:string rightBottom:string visible:bool bmpId:string onclickId:string help:string layer:int windowId:string layoutId:string Image id:string xPos:int yPos:int leftTop:string rightBottom:string visible:bool bmpId:string onclickId:string help:string layer:int windowId:string layoutId:string
Text id:string xPos:int yPos:int fontId:string text:string width:int help:string layer:int windowId:string layoutId:string Text id:string xPos:int yPos:int fontId:string text:string width:int color:uint32_t help:string layer:int windowId:string layoutId:string
RadialSlider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string sequence:string nbImages:int minAngle:float maxAngle:float value:string tooltip:string help:string layer:int windowId:string layoutId:string RadialSlider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string sequence:string nbImages:int minAngle:float maxAngle:float value:string tooltip:string help:string layer:int windowId:string layoutId:string
Slider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string upId:string downId:string overId:string points:string thickness:int value:string tooltip:string help:string layer:int windowId:string layoutId:string Slider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string upId:string downId:string overId:string points:string thickness:int value:string tooltip:string help:string layer:int windowId:string layoutId:string
List id:string xPos:int yPos:int width:int height:int leftTop:string rightBottom:string fontId:string var:string fgColor:uint32_t playColor:uint32_t bgColor1:uint32_t bgColor2:uint32_t selColor:uint32_t help:string layer:int windowId:string layoutId:string List id:string xPos:int yPos:int width:int height:int leftTop:string rightBottom:string fontId:string var:string fgColor:uint32_t playColor:uint32_t bgColor1:uint32_t bgColor2:uint32_t selColor:uint32_t help:string layer:int windowId:string layoutId:string
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* builder_data.hpp * builder_data.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: builder_data.hpp,v 1.4 2004/02/27 13:24:12 gbazin Exp $ * $Id: builder_data.hpp,v 1.5 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr>
...@@ -28,12 +28,13 @@ ...@@ -28,12 +28,13 @@
#ifndef BUILDER_DATA_HPP #ifndef BUILDER_DATA_HPP
#define BUILDER_DATA_HPP #define BUILDER_DATA_HPP
using namespace std;
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <list> #include <list>
#include <map>
#include <string> #include <string>
using namespace std;
/// Structure for mapping data from XML file /// Structure for mapping data from XML file
struct BuilderData struct BuilderData
{ {
...@@ -206,8 +207,8 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom( ...@@ -206,8 +207,8 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom(
/// Type definition /// Type definition
struct Text struct Text
{ {
Text( const string & id, int xPos, int yPos, const string & fontId, const string & text, int width, const string & help, int layer, const string & windowId, const string & layoutId ): Text( const string & id, int xPos, int yPos, const string & fontId, const string & text, int width, uint32_t color, const string & help, int layer, const string & windowId, const string & layoutId ):
m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_fontId( fontId ), m_text( text ), m_width( width ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {} m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_fontId( fontId ), m_text( text ), m_width( width ), m_color( color ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
const string m_id; const string m_id;
int m_xPos; int m_xPos;
...@@ -215,6 +216,7 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_fontId( fontId ), m_text( text ), ...@@ -215,6 +216,7 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_fontId( fontId ), m_text( text ),
const string m_fontId; const string m_fontId;
const string m_text; const string m_text;
int m_width; int m_width;
uint32_t m_color;
const string m_help; const string m_help;
int m_layer; int m_layer;
const string m_windowId; const string m_windowId;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* skin_parser.cpp * skin_parser.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2004 VideoLAN * Copyright (C) 2004 VideoLAN
* $Id: skin_parser.cpp,v 1.1 2004/01/25 11:44:19 asmax Exp $ * $Id: skin_parser.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* *
...@@ -163,7 +163,8 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr ) ...@@ -163,7 +163,8 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr )
{ {
const BuilderData::Text textData( attr["id"], atoi( attr["x"] ) + const BuilderData::Text textData( attr["id"], atoi( attr["x"] ) +
m_xOffset, atoi( attr["y"] ) + m_yOffset, attr["font"], m_xOffset, atoi( attr["y"] ) + m_yOffset, attr["font"],
attr["text"], atoi( attr["width"] ), attr["help"], m_curLayer, attr["text"], atoi( attr["width"] ),
ConvertColor( attr["color"] ), attr["help"], m_curLayer,
m_curWindowId, m_curLayoutId ); m_curWindowId, m_curLayoutId );
m_curLayer++; m_curLayer++;
m_data.m_listText.push_back( textData ); m_data.m_listText.push_back( textData );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* generic_layout.cpp * generic_layout.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: generic_layout.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: generic_layout.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -123,6 +123,7 @@ const list<LayeredControl> &GenericLayout::getControlList() const ...@@ -123,6 +123,7 @@ const list<LayeredControl> &GenericLayout::getControlList() const
void GenericLayout::onControlUpdate( const CtrlGeneric &rCtrl ) void GenericLayout::onControlUpdate( const CtrlGeneric &rCtrl )
{ {
// TODO: refresh only the needed area if possible
refreshAll(); refreshAll();
} }
...@@ -181,11 +182,11 @@ void GenericLayout::refreshAll() ...@@ -181,11 +182,11 @@ void GenericLayout::refreshAll()
list<LayeredControl>::const_iterator iter; list<LayeredControl>::const_iterator iter;
for( iter = m_controlList.begin(); iter != m_controlList.end(); iter++ ) for( iter = m_controlList.begin(); iter != m_controlList.end(); iter++ )
{ {
const Position *pPos = (*iter).m_pControl->getPosition(); CtrlGeneric *pCtrl = (*iter).m_pControl;
if( pPos ) const Position *pPos = pCtrl->getPosition();
if( pCtrl->isVisible() && pPos )
{ {
(*iter).m_pControl->draw( *m_pImage, pPos->getLeft(), pCtrl->draw( *m_pImage, pPos->getLeft(), pPos->getTop() );
pPos->getTop() );
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* generic_window.cpp * generic_window.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: generic_window.cpp,v 1.2 2004/01/25 21:38:57 asmax Exp $ * $Id: generic_window.cpp,v 1.3 2004/02/29 16:49:55 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -503,8 +503,9 @@ CtrlGeneric *GenericWindow::findHitControl( int xPos, int yPos ) ...@@ -503,8 +503,9 @@ CtrlGeneric *GenericWindow::findHitControl( int xPos, int yPos )
int xRel = xPos - pos->getLeft(); int xRel = xPos - pos->getLeft();
int yRel = yPos - pos->getTop(); int yRel = yPos - pos->getTop();
CtrlGeneric *pCtrl = (*iter).m_pControl;
// Control hit ? // Control hit ?
if( (*iter).m_pControl->mouseOver( xRel, yRel ) ) if( pCtrl->isVisible() && pCtrl->mouseOver( xRel, yRel ) )
{ {
pNewHitControl = (*iter).m_pControl; pNewHitControl = (*iter).m_pControl;
break; break;
......
...@@ -176,11 +176,8 @@ ...@@ -176,11 +176,8 @@
y CDATA "0" y CDATA "0"
text CDATA "\0" text CDATA "\0"
font CDATA #REQUIRED font CDATA #REQUIRED
align CDATA "left" color CDATA "#000000"
width CDATA "0" width CDATA "0"
display CDATA "none"
scroll CDATA "true"
scrollspace CDATA "20"
help CDATA "\0" help CDATA "\0"
> >
<!ELEMENT Playlist (Slider)> <!ELEMENT Playlist (Slider)>
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<Group x="0" y="0"> <Group x="0" y="0">
<Anchor x="7" y="151" priority="100"/> <Anchor x="7" y="151" priority="100"/>
<Image x="0" y="0" image="mainbody" onclick="move"/> <Image x="0" y="0" image="mainbody" onclick="move"/>
<Text font="default_font" width="70" x="287" y="79" text="$T"/> <Text font="default_font" width="70" x="287" y="79" text="$T" color="#000000"/>
<Button x="42" y="42" up="preferences" down="preferences_onclick" over="preferences" action="dialogs.prefs()" tooltiptext="Preferences"/> <Button x="42" y="42" up="preferences" down="preferences_onclick" over="preferences" action="dialogs.prefs()" tooltiptext="Preferences"/>
<Button x="17" y="64" up="stop" down="stop_onclick" over="stop" action="vlc.stop()" tooltiptext="Stop"/> <Button x="17" y="64" up="stop" down="stop_onclick" over="stop" action="vlc.stop()" tooltiptext="Stop"/>
<CheckBox x="42" y="87" up1="playlist_button" down1="playlist_button_onclick" up2="playlist_button2" down2="playlist_button_onclick2" state="playlist_window.isVisible" action1="playlist_window.show()" action2="playlist_window.hide()" tooltiptext1="Show Playlist" tooltiptext2="Hide Playlist"/> <CheckBox x="42" y="87" up1="playlist_button" down1="playlist_button_onclick" up2="playlist_button2" down2="playlist_button_onclick2" state="playlist_window.isVisible" action1="playlist_window.show()" action2="playlist_window.hide()" tooltiptext1="Show Playlist" tooltiptext2="Hide Playlist"/>
......
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