Changeset a2ce62f83f57bf024b89ec3b93c349f34b440f29

Show
Ignore:
Timestamp:
02/29/04 17:49:55 (4 years ago)
Author:
Cyril Deguet <asmax@videolan.org>
git-committer:
Cyril Deguet <asmax@videolan.org> 1078073395 +0000
git-parent:

[0925e59b790ece071b6c6bc868bca0827c91708b]

git-author:
Cyril Deguet <asmax@videolan.org> 1078073395 +0000
Message:

* 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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/skins2/controls/ctrl_button.cpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_button.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_button.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    3434                        const GenericBitmap &rBmpOver, 
    3535                        const GenericBitmap &rBmpDown, CmdGeneric &rCommand, 
    36                         const UString &rTooltip, const UString &rHelp ): 
    37     CtrlGeneric( pIntf, rHelp ), m_fsm( pIntf ), m_rCommand( rCommand ), 
    38     m_tooltip( rTooltip ), 
     36                        const UString &rTooltip, const UString &rHelp, 
     37                        VarBool *pVisible ): 
     38    CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ), 
     39    m_rCommand( rCommand ), m_tooltip( rTooltip ), 
    3940    m_cmdUpOverDownOver( this, &transUpOverDownOver ), 
    4041    m_cmdDownOverUpOver( this, &transDownOverUpOver ), 
  • modules/gui/skins2/controls/ctrl_button.hpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_button.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_button.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    4343                    const GenericBitmap &rBmpDown, 
    4444                    CmdGeneric &rCommand, const UString &rTooltip, 
    45                     const UString &rHelp ); 
     45                    const UString &rHelp, VarBool *pVisible ); 
    4646 
    4747        virtual ~CtrlButton(); 
  • modules/gui/skins2/controls/ctrl_checkbox.cpp

    r75feba0 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_checkbox.cpp,v 1.2 2004/01/18 19:54:46 asmax Exp $ 
     5 * $Id: ctrl_checkbox.cpp,v 1.3 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    4242                            const UString &rTooltip1, 
    4343                            const UString &rTooltip2, 
    44                             VarBool &rVariable, const UString &rHelp ): 
    45     CtrlGeneric( pIntf, rHelp ), m_fsm( pIntf ), m_rVariable( rVariable ), 
     44                            VarBool &rVariable, const UString &rHelp, 
     45                            VarBool *pVisible ): 
     46    CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ), 
     47    m_rVariable( rVariable ), 
    4648    m_rCommand1( rCommand1 ), m_rCommand2( rCommand2 ), 
    4749    m_tooltip1( rTooltip1 ), m_tooltip2( rTooltip2 ), 
     
    248250 
    249251 
    250 void CtrlCheckbox::onUpdate( Subject<VarBool> &rVariable ) 
     252void CtrlCheckbox::onVarBoolUpdate( VarBool &rVariable ) 
    251253{ 
    252254    changeButton(); 
  • modules/gui/skins2/controls/ctrl_checkbox.hpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_checkbox.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_checkbox.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    3333class OSGraphics; 
    3434class CmdGeneric; 
    35 class VarBool; 
    3635 
    3736 
    3837/// Base class for checkbox controls 
    39 class CtrlCheckbox: public CtrlGeneric, public Observer<VarBool> 
     38class CtrlCheckbox: public CtrlGeneric 
    4039{ 
    4140    public: 
     
    5049                      CmdGeneric &rCommand1, CmdGeneric &rCommand2, 
    5150                      const UString &rTooltip1, const UString &rTooltip2, 
    52                       VarBool &rVariable, const UString &rHelp ); 
     51                      VarBool &rVariable, const UString &rHelp, 
     52                      VarBool *pVisible); 
    5353 
    5454        virtual ~CtrlCheckbox(); 
     
    113113 
    114114        /// Method called when the observed variable is modified 
    115         virtual void onUpdate( Subject<VarBool> &rVariable ); 
     115        virtual void onVarBoolUpdate( VarBool &rVariable ); 
    116116 
    117117        /// Helper function to update the current state of images 
  • modules/gui/skins2/controls/ctrl_flat.hpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_flat.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_flat.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    3333{ 
    3434    protected: 
    35         CtrlFlat( intf_thread_t *pIntf, const UString &rHelp ): 
    36             CtrlGeneric( pIntf, rHelp ) {} 
     35        CtrlFlat( intf_thread_t *pIntf, const UString &rHelp, 
     36                  VarBool *pVisible ): 
     37            CtrlGeneric( pIntf, rHelp, pVisible ) {} 
     38 
    3739        virtual ~CtrlFlat() {} 
    3840}; 
  • modules/gui/skins2/controls/ctrl_generic.cpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_generic.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_generic.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    2828#include "../src/os_graphics.hpp" 
    2929#include "../utils/position.hpp" 
     30#include "../utils/var_bool.hpp" 
    3031 
    3132 
    32 CtrlGeneric::CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp ): 
     33CtrlGeneric::CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp, 
     34                          VarBool *pVisible): 
    3335    SkinObject( pIntf ), m_pLayout( NULL ), m_pPosition( NULL ), 
    34     m_help( rHelp ) 
     36    m_help( rHelp ), m_pVisible( pVisible ) 
    3537{ 
     38    // Observe the visibility variable 
     39    if( m_pVisible ) 
     40    { 
     41        m_pVisible->addObserver( this ); 
     42    } 
    3643} 
    3744 
     
    4249    { 
    4350        delete m_pPosition; 
     51    } 
     52    if( m_pVisible ) 
     53    { 
     54        m_pVisible->delObserver( this ); 
    4455    } 
    4556} 
     
    109120} 
    110121 
     122 
     123bool CtrlGeneric::isVisible() const 
     124{ 
     125    return !m_pVisible || m_pVisible->get(); 
     126} 
     127 
     128 
     129void CtrlGeneric::onUpdate( Subject<VarBool> &rVariable ) 
     130{ 
     131    // Is it the visibily variable ? 
     132    if( &rVariable == m_pVisible ) 
     133    { 
     134        // Redraw the layout 
     135        notifyLayout(); 
     136    } 
     137    else 
     138    { 
     139        // Call the user-defined callback 
     140        onVarBoolUpdate( (VarBool&)rVariable ); 
     141    } 
     142} 
     143 
  • modules/gui/skins2/controls/ctrl_generic.hpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_generic.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_generic.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    3030#include "../utils/fsm.hpp" 
    3131#include "../utils/ustring.hpp" 
     32#include "../utils/observer.hpp" 
    3233 
    3334class EvtGeneric; 
     
    3637class Position; 
    3738class GenericWindow; 
     39class VarBool; 
    3840 
    3941 
    4042/// Base class for controls 
    41 class CtrlGeneric: public SkinObject 
     43class CtrlGeneric: public SkinObject, public Observer<VarBool> 
    4244{ 
    4345    public: 
     
    7476        virtual bool isFocusable() const { return false; } 
    7577 
     78        /// Return true if the control is visible 
     79        virtual bool isVisible() const; 
     80 
    7681    protected: 
    77         CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp ); 
     82        // If pVisible is NULL, the control is always visible 
     83        CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp, 
     84                     VarBool *pVisible = NULL ); 
    7885 
    7986        /// Tell the layout when the image has changed 
     
    96103        virtual void onPositionChange() {} 
    97104 
     105        /// Overload this method to get notified of bool variable changes 
     106        virtual void onVarBoolUpdate( VarBool &rVar ) {} 
     107 
    98108    private: 
    99109        /// Associated layout 
     
    103113        /// Help text 
    104114        UString m_help; 
     115        /// Visibilty variable 
     116        VarBool *m_pVisible; 
     117 
     118        /// Method called when an observed bool variable is changed 
     119        virtual void onUpdate( Subject<VarBool> &rVariable ); 
    105120}; 
    106121 
  • modules/gui/skins2/controls/ctrl_image.cpp

    rce41dfb ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_image.cpp,v 1.2 2004/02/01 14:44:11 asmax Exp $ 
     5 * $Id: ctrl_image.cpp,v 1.3 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    3333 
    3434CtrlImage::CtrlImage( intf_thread_t *pIntf, const GenericBitmap &rBitmap, 
    35                       const UString &rHelp ): 
    36     CtrlFlat( pIntf, rHelp ), m_rBitmap( rBitmap ) 
     35                      const UString &rHelp, VarBool *pVisible ): 
     36    CtrlFlat( pIntf, rHelp, pVisible ), m_rBitmap( rBitmap ) 
    3737{ 
    3838    OSFactory *pOsFactory = OSFactory::instance( pIntf ); 
  • modules/gui/skins2/controls/ctrl_image.hpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_image.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_image.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    3939        // Create an image with the given bitmap (which is NOT copied) 
    4040        CtrlImage( intf_thread_t *pIntf, const GenericBitmap &rBitmap, 
    41                    const UString &rHelp ); 
     41                   const UString &rHelp, VarBool *pVisible ); 
    4242        virtual ~CtrlImage(); 
    4343 
  • modules/gui/skins2/controls/ctrl_list.cpp

    r6ae1b0c ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_list.cpp,v 1.2 2004/02/27 13:24:12 gbazin Exp $ 
     5 * $Id: ctrl_list.cpp,v 1.3 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    4242                    uint32_t fgColor, uint32_t playColor, uint32_t bgColor1, 
    4343                    uint32_t bgColor2, uint32_t selColor, 
    44                     const UString &rHelp ): 
    45     CtrlGeneric( pIntf, rHelp ), m_rList( rList ), m_rFont( rFont ), 
     44                    const UString &rHelp, VarBool *pVisible ): 
     45    CtrlGeneric( pIntf, rHelp, pVisible ), m_rList( rList ), m_rFont( rFont ), 
    4646    m_fgColor( fgColor ), m_playColor( playColor ), m_bgColor1( bgColor1 ), 
    4747    m_bgColor2( bgColor2 ), m_selColor( selColor ), m_pLastSelected( NULL ), 
  • modules/gui/skins2/controls/ctrl_list.hpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_list.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_list.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    4242                  uint32_t fgcolor, uint32_t playcolor, uint32_t bgcolor1, 
    4343                  uint32_t bgcolor2, uint32_t selColor, 
    44                   const UString &rHelp ); 
     44                  const UString &rHelp, VarBool *pVisible ); 
    4545        virtual ~CtrlList(); 
    4646 
  • modules/gui/skins2/controls/ctrl_move.cpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_move.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_move.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    3434CtrlMove::CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager, 
    3535                    CtrlFlat &rCtrl, GenericWindow &rWindow, 
    36                     const UString &rHelp ): 
    37     CtrlFlat( pIntf, rHelp ), m_fsm( pIntf ), 
     36                    const UString &rHelp, VarBool *pVisible ): 
     37    CtrlFlat( pIntf, rHelp, pVisible ), m_fsm( pIntf ), 
    3838    m_rWindowManager( rWindowManager ), 
    3939    m_rCtrl( rCtrl ), m_rWindow( rWindow ), 
  • modules/gui/skins2/controls/ctrl_move.hpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_move.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_move.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    4040        CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager, 
    4141                  CtrlFlat &rCtrl, GenericWindow &rWindow, 
    42                   const UString &rHelp ); 
     42                  const UString &rHelp, VarBool *pVisible ); 
    4343        virtual ~CtrlMove() {} 
    4444 
  • modules/gui/skins2/controls/ctrl_radialslider.cpp

    rc45fb12 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_radialslider.cpp,v 1.2 2004/01/11 17:12:17 asmax Exp $ 
     5 * $Id: ctrl_radialslider.cpp,v 1.3 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    3737                                    const GenericBitmap &rBmpSeq, int numImg, 
    3838                                    VarPercent &rVariable, float minAngle, 
    39                                     float maxAngle, const UString &rHelp ): 
    40     CtrlGeneric( pIntf, rHelp ), m_fsm( pIntf ), m_numImg( numImg ), 
     39                                    float maxAngle, const UString &rHelp, 
     40                                    VarBool *pVisible ): 
     41    CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ), m_numImg( numImg ), 
    4142    m_rVariable( rVariable ), m_minAngle( minAngle ), m_maxAngle( maxAngle ), 
    4243    m_cmdUpDown( this, &transUpDown ), m_cmdDownUp( this, &transDownUp ), 
  • modules/gui/skins2/controls/ctrl_radialslider.hpp

    rc45fb12 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_radialslider.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $ 
     5 * $Id: ctrl_radialslider.hpp,v 1.3 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    4444        CtrlRadialSlider( intf_thread_t *pIntf, const GenericBitmap &rBmpSeq, 
    4545                          int numImg, VarPercent &rVariable, float minAngle, 
    46                           float maxAngle, const UString &rHelp ); 
     46                          float maxAngle, const UString &rHelp, 
     47                          VarBool *pVisible ); 
    4748 
    4849        virtual ~CtrlRadialSlider(); 
  • modules/gui/skins2/controls/ctrl_resize.cpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_resize.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_resize.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    3434 
    3535CtrlResize::CtrlResize( intf_thread_t *pIntf, CtrlFlat &rCtrl, 
    36                         GenericLayout &rLayout, const UString &rHelp ): 
    37     CtrlFlat( pIntf, rHelp ), m_fsm( pIntf ), m_rCtrl( rCtrl ), 
     36                        GenericLayout &rLayout, const UString &rHelp, 
     37                        VarBool *pVisible ): 
     38    CtrlFlat( pIntf, rHelp, pVisible ), m_fsm( pIntf ), m_rCtrl( rCtrl ), 
    3839    m_rLayout( rLayout ), m_cmdResizeResize( this, &transResizeResize ), 
    3940    m_cmdStillResize( this, &transStillResize ), 
  • modules/gui/skins2/controls/ctrl_resize.hpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_resize.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_resize.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    3838    public: 
    3939        CtrlResize( intf_thread_t *pIntf, CtrlFlat &rCtrl, 
    40                     GenericLayout &rLayout, const UString &rHelp ); 
     40                    GenericLayout &rLayout, const UString &rHelp, 
     41                    VarBool *pVisible ); 
    4142        virtual ~CtrlResize() {} 
    4243 
  • modules/gui/skins2/controls/ctrl_slider.cpp

    r675864e ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_slider.cpp,v 1.3 2004/02/01 21:13:04 ipkiss Exp $ 
     5 * $Id: ctrl_slider.cpp,v 1.4 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    4848                                    const UString &rTooltip, 
    4949                                    const UString &rHelp ): 
    50     CtrlGeneric( pIntf, rHelp ), m_fsm( pIntf ), m_rVariable( rVariable ), 
    51     m_pVisible( pVisible ), m_tooltip( rTooltip ), 
     50    CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ), 
     51    m_rVariable( rVariable ), m_tooltip( rTooltip ), 
    5252    m_width( rCurve.getWidth() ), m_height( rCurve.getHeight() ), 
    5353    m_cmdOverDown( this, &transOverDown ), 
     
    9292    m_rVariable.addObserver( this ); 
    9393 
    94     // Observe the visibility variable 
    95     if( m_pVisible ) 
    96     { 
    97         m_pVisible->addObserver( this ); 
    98     } 
    99  
    10094    // Initial position of the cursor 
    10195    m_lastPercentage = m_rVariable.get(); 
     
    106100{ 
    107101    m_rVariable.delObserver( this ); 
    108     if( m_pVisible ) 
    109     { 
    110         m_pVisible->delObserver( this ); 
    111     } 
    112102    SKINS_DELETE( m_pImgUp ); 
    113103    SKINS_DELETE( m_pImgDown ); 
     
    151141void CtrlSliderCursor::draw( OSGraphics &rImage, int xDest, int yDest ) 
    152142{ 
    153     if( m_pImg && (!m_pVisible || m_pVisible->get())
     143    if( m_pImg
    154144    { 
    155145        // Compute the position of the cursor 
     
    174164{ 
    175165    // The position has changed 
    176     notifyLayout(); 
    177 } 
    178  
    179  
    180 void CtrlSliderCursor::onUpdate( Subject<VarBool> &rVariable ) 
    181 { 
    182     // The visibility variable has changed 
    183166    notifyLayout(); 
    184167} 
     
    321304                            int thickness, VarBool *pVisible, 
    322305                            const UString &rHelp ): 
    323     CtrlGeneric( pIntf, rHelp ), m_rCursor( rCursor ), m_rVariable( rVariable ), 
    324     m_thickness( thickness ), m_pVisible( pVisible ), m_curve( rCurve ), 
     306    CtrlGeneric( pIntf, rHelp, pVisible ), m_rCursor( rCursor ), 
     307    m_rVariable( rVariable ), m_thickness( thickness ), m_curve( rCurve ), 
    325308    m_width( rCurve.getWidth() ), m_height( rCurve.getHeight() ) 
    326309{ 
     
    330313bool CtrlSliderBg::mouseOver( int x, int y ) const 
    331314{ 
    332     if( m_pVisible && !m_pVisible->get() ) 
    333     { 
    334         return false; 
    335     } 
    336  
    337315    // Compute the resize factors 
    338316    float factorX, factorY; 
     
    393371 
    394372 
    395 void CtrlSliderBg::onUpdate( Subject<VarBool> &rVariable ) 
    396 { 
    397     // The visibility variable has changed 
    398     notifyLayout(); 
    399 } 
    400  
    401  
    402373void CtrlSliderBg::getResizeFactors( float &rFactorX, float &rFactorY ) const 
    403374{ 
  • modules/gui/skins2/controls/ctrl_slider.hpp

    rc45fb12 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_slider.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $ 
     5 * $Id: ctrl_slider.hpp,v 1.3 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    3535class OSGraphics; 
    3636class VarPercent; 
    37 class VarBool; 
    3837 
    3938 
    4039/// Cursor of a slider 
    41 class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>, 
    42     public Observer<VarBool> 
     40class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent> 
    4341{ 
    4442    public: 
     
    7169        /// Variable associated to the cursor 
    7270        VarPercent &m_rVariable; 
    73         /// Visibility variable 
    74         VarBool *m_pVisible; 
    7571        /// Tooltip text 
    7672        const UString m_tooltip; 
     
    110106        virtual void onUpdate( Subject<VarPercent> &rVariable ); 
    111107 
    112         /// Method called when the visibility variable is modified 
    113         virtual void onUpdate( Subject<VarBool> &rVariable ); 
    114  
    115108        /// Methode to compute the resize factors 
    116109        void getResizeFactors( float &rFactorX, float &rFactorY ) const; 
     
    122115{ 
    123116    public: 
    124         /// If pVisible is NULL, the control is always visible 
    125117        CtrlSliderBg( intf_thread_t *pIntf, CtrlSliderCursor &rCursor, 
    126118                      const Bezier &rCurve, VarPercent &rVariable, 
     
    141133        /// Thickness of the curve 
    142134        int m_thickness; 
    143         /// Visibility variable 
    144         VarBool *m_pVisible; 
    145135        /// Bezier curve of the slider 
    146136        const Bezier m_curve; 
     
    150140        /// Methode to compute the resize factors 
    151141        void getResizeFactors( float &rFactorX, float &rFactorY ) const; 
    152  
    153         /// Method called when the visibility variable is modified 
    154         virtual void onUpdate( Subject<VarBool> &rVariable ); 
    155142}; 
    156143 
  • modules/gui/skins2/controls/ctrl_text.cpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_text.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_text.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    4343CtrlText::CtrlText( intf_thread_t *pIntf, VarText &rVariable, 
    4444                    const GenericFont &rFont, const UString &rHelp, 
    45                     uint32_t color ): 
    46     CtrlGeneric( pIntf, rHelp ), m_fsm( pIntf ), m_rVariable( rVariable ), 
    47     m_cmdToManual( this, &transToManual ), 
     45                    uint32_t color, VarBool *pVisible ): 
     46    CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ), 
     47    m_rVariable( rVariable ), m_cmdToManual( this, &transToManual ), 
    4848    m_cmdManualMoving( this, &transManualMoving ), 
    4949    m_cmdManualStill( this, &transManualStill ), 
  • modules/gui/skins2/controls/ctrl_text.hpp

    rb7dc5e8 ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: ctrl_text.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ 
     5 * $Id: ctrl_text.hpp,v 1.2 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    4545        CtrlText( intf_thread_t *pIntf, VarText &rVariable, 
    4646                  const GenericFont &rFont, const UString &rHelp, 
    47                   uint32_t color = 0 ); 
     47                  uint32_t color, VarBool *pVisible ); 
    4848        virtual ~CtrlText(); 
    4949 
  • modules/gui/skins2/parser/builder.cpp

    r6ae1b0c ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: builder.cpp,v 1.6 2004/02/27 13:24:12 gbazin Exp $ 
     5 * $Id: builder.cpp,v 1.7 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    217217    CtrlButton *pButton = new CtrlButton( getIntf(), *pBmpUp, *pBmpOver, 
    218218        *pBmpDown, *pCommand, UString( getIntf(), rData.m_tooltip.c_str() ), 
    219         UString( getIntf(), rData.m_help.c_str() ) ); 
     219        UString( getIntf(), rData.m_help.c_str() ), NULL ); 
    220220 
    221221    // Compute the position of the control 
     
    288288        *pCommand2, UString( getIntf(), rData.m_tooltip1.c_str() ), 
    289289        UString( getIntf(), rData.m_tooltip2.c_str() ), *pVar, 
    290         UString( getIntf(), rData.m_help.c_str() ) ); 
     290        UString( getIntf(), rData.m_help.c_str() ), NULL ); 
    291291 
    292292    // Compute the position of the control 
     
    323323 
    324324    CtrlImage *pImage = new CtrlImage( getIntf(), *pBmp, 
    325                                 UString( getIntf(), rData.m_help.c_str() ) ); 
     325                                UString( getIntf(), rData.m_help.c_str() ), 
     326                                NULL); 
    326327 
    327328    // Compute the position of the control 
     
    335336    { 
    336337        CtrlMove *pMove = new CtrlMove( getIntf(), m_pTheme->getWindowManager(), 
    337              *pImage, *pWindow, UString( getIntf(), rData.m_help.c_str() ) ); 
     338             *pImage, *pWindow, UString( getIntf(), rData.m_help.c_str() ), 
     339             NULL); 
    338340        pLayout->addControl( pMove, pos, rData.m_layer ); 
    339341    } 
     
    341343    { 
    342344        CtrlResize *pResize = new CtrlResize( getIntf(), *pImage, *pLayout, 
    343                 UString( getIntf(), rData.m_help.c_str() ) ); 
     345                UString( getIntf(), rData.m_help.c_str() ), NULL ); 
    344346        pLayout->addControl( pResize, pos, rData.m_layer ); 
    345347    } 
     
    376378 
    377379    CtrlText *pText = new CtrlText( getIntf(), *pVar, *pFont, 
    378             UString( getIntf(), rData.m_help.c_str() ) ); 
     380            UString( getIntf(), rData.m_help.c_str() ), rData.m_color, NULL ); 
    379381 
    380382    int height = pFont->getSize(); 
     
    415417        new CtrlRadialSlider( getIntf(), *pSeq, rData.m_nbImages, *pVar, 
    416418                              rData.m_minAngle, rData.m_maxAngle, 
    417                               UString( getIntf(), rData.m_help.c_str() ) ); 
     419                              UString( getIntf(), rData.m_help.c_str() ), 
     420                              NULL ); 
    418421 
    419422    // XXX: resizing is not supported 
     
    525528       rData.m_fgColor, rData.m_playColor, rData.m_bgColor1, 
    526529       rData.m_bgColor2, rData.m_selColor, 
    527        UString( getIntf(), rData.m_help.c_str() ) ); 
     530       UString( getIntf(), rData.m_help.c_str() ), NULL ); 
    528531 
    529532    // Compute the position of the control 
  • modules/gui/skins2/parser/builder_data.def

    r181e921 ra2ce62f  
    88Checkbox 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 
    99Image id:string xPos:int yPos:int leftTop:string rightBottom:string visible:bool bmpId:string onclickId:string help:string layer:int windowId:string layoutId:string 
    10 Text id:string xPos:int yPos:int fontId:string text:string width:int help:string layer:int windowId:string layoutId:string 
     10Text id:string xPos:int yPos:int fontId:string text:string width:int color:uint32_t help:string layer:int windowId:string layoutId:string 
    1111RadialSlider 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 
    1212Slider 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 
  • modules/gui/skins2/parser/builder_data.hpp

    r6ae1b0c ra2ce62f  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: builder_data.hpp,v 1.4 2004/02/27 13:24:12 gbazin Exp $ 
     5 * $Id: builder_data.hpp,v 1.5 2004/02/29 16:49:55 asmax Exp $ 
    66 * 
    77 * Authors: Cyril Deguet     <asmax@via.ecp.fr> 
     
    2929#define BUILDER_DATA_HPP 
    3030 
     31using namespace std; 
     32 
    3133#include <vlc/vlc.h> 
    3234#include <list> 
     35#include <map> 
    3336#include <string> 
    34  
    35 using namespace std; 
    3637 
    3738/// Structure for mapping data from XML file 
     
    207208    struct Text 
    208209    { 
    209         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 ): 
    210 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 ) {} 
     210        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 ): 
     211m_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 ) {} 
    211212 
    212213        const string m_id; 
     
    216217        const string m_text; 
    217218        int m_width; 
     219        uint32_t m_color; 
    218220        const string m_help; 
    219221        int m_layer;