Changeset a2ce62f83f57bf024b89ec3b93c349f34b440f29
- 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
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 34 | 34 | const GenericBitmap &rBmpOver, |
|---|
| 35 | 35 | 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 ), |
|---|
| 39 | 40 | m_cmdUpOverDownOver( this, &transUpOverDownOver ), |
|---|
| 40 | 41 | m_cmdDownOverUpOver( this, &transDownOverUpOver ), |
|---|
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 43 | 43 | const GenericBitmap &rBmpDown, |
|---|
| 44 | 44 | CmdGeneric &rCommand, const UString &rTooltip, |
|---|
| 45 | | const UString &rHelp ); |
|---|
| | 45 | const UString &rHelp, VarBool *pVisible ); |
|---|
| 46 | 46 | |
|---|
| 47 | 47 | virtual ~CtrlButton(); |
|---|
| r75feba0 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 42 | 42 | const UString &rTooltip1, |
|---|
| 43 | 43 | 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 ), |
|---|
| 46 | 48 | m_rCommand1( rCommand1 ), m_rCommand2( rCommand2 ), |
|---|
| 47 | 49 | m_tooltip1( rTooltip1 ), m_tooltip2( rTooltip2 ), |
|---|
| … | … | |
| 248 | 250 | |
|---|
| 249 | 251 | |
|---|
| 250 | | void CtrlCheckbox::onUpdate( Subject<VarBool> &rVariable ) |
|---|
| | 252 | void CtrlCheckbox::onVarBoolUpdate( VarBool &rVariable ) |
|---|
| 251 | 253 | { |
|---|
| 252 | 254 | changeButton(); |
|---|
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 33 | 33 | class OSGraphics; |
|---|
| 34 | 34 | class CmdGeneric; |
|---|
| 35 | | class VarBool; |
|---|
| 36 | 35 | |
|---|
| 37 | 36 | |
|---|
| 38 | 37 | /// Base class for checkbox controls |
|---|
| 39 | | class CtrlCheckbox: public CtrlGeneric, public Observer<VarBool> |
|---|
| | 38 | class CtrlCheckbox: public CtrlGeneric |
|---|
| 40 | 39 | { |
|---|
| 41 | 40 | public: |
|---|
| … | … | |
| 50 | 49 | CmdGeneric &rCommand1, CmdGeneric &rCommand2, |
|---|
| 51 | 50 | const UString &rTooltip1, const UString &rTooltip2, |
|---|
| 52 | | VarBool &rVariable, const UString &rHelp ); |
|---|
| | 51 | VarBool &rVariable, const UString &rHelp, |
|---|
| | 52 | VarBool *pVisible); |
|---|
| 53 | 53 | |
|---|
| 54 | 54 | virtual ~CtrlCheckbox(); |
|---|
| … | … | |
| 113 | 113 | |
|---|
| 114 | 114 | /// Method called when the observed variable is modified |
|---|
| 115 | | virtual void onUpdate( Subject<VarBool> &rVariable ); |
|---|
| | 115 | virtual void onVarBoolUpdate( VarBool &rVariable ); |
|---|
| 116 | 116 | |
|---|
| 117 | 117 | /// Helper function to update the current state of images |
|---|
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 33 | 33 | { |
|---|
| 34 | 34 | 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 | |
|---|
| 37 | 39 | virtual ~CtrlFlat() {} |
|---|
| 38 | 40 | }; |
|---|
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 28 | 28 | #include "../src/os_graphics.hpp" |
|---|
| 29 | 29 | #include "../utils/position.hpp" |
|---|
| | 30 | #include "../utils/var_bool.hpp" |
|---|
| 30 | 31 | |
|---|
| 31 | 32 | |
|---|
| 32 | | CtrlGeneric::CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp ): |
|---|
| | 33 | CtrlGeneric::CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp, |
|---|
| | 34 | VarBool *pVisible): |
|---|
| 33 | 35 | SkinObject( pIntf ), m_pLayout( NULL ), m_pPosition( NULL ), |
|---|
| 34 | | m_help( rHelp ) |
|---|
| | 36 | m_help( rHelp ), m_pVisible( pVisible ) |
|---|
| 35 | 37 | { |
|---|
| | 38 | // Observe the visibility variable |
|---|
| | 39 | if( m_pVisible ) |
|---|
| | 40 | { |
|---|
| | 41 | m_pVisible->addObserver( this ); |
|---|
| | 42 | } |
|---|
| 36 | 43 | } |
|---|
| 37 | 44 | |
|---|
| … | … | |
| 42 | 49 | { |
|---|
| 43 | 50 | delete m_pPosition; |
|---|
| | 51 | } |
|---|
| | 52 | if( m_pVisible ) |
|---|
| | 53 | { |
|---|
| | 54 | m_pVisible->delObserver( this ); |
|---|
| 44 | 55 | } |
|---|
| 45 | 56 | } |
|---|
| … | … | |
| 109 | 120 | } |
|---|
| 110 | 121 | |
|---|
| | 122 | |
|---|
| | 123 | bool CtrlGeneric::isVisible() const |
|---|
| | 124 | { |
|---|
| | 125 | return !m_pVisible || m_pVisible->get(); |
|---|
| | 126 | } |
|---|
| | 127 | |
|---|
| | 128 | |
|---|
| | 129 | void 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 | |
|---|
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 30 | 30 | #include "../utils/fsm.hpp" |
|---|
| 31 | 31 | #include "../utils/ustring.hpp" |
|---|
| | 32 | #include "../utils/observer.hpp" |
|---|
| 32 | 33 | |
|---|
| 33 | 34 | class EvtGeneric; |
|---|
| … | … | |
| 36 | 37 | class Position; |
|---|
| 37 | 38 | class GenericWindow; |
|---|
| | 39 | class VarBool; |
|---|
| 38 | 40 | |
|---|
| 39 | 41 | |
|---|
| 40 | 42 | /// Base class for controls |
|---|
| 41 | | class CtrlGeneric: public SkinObject |
|---|
| | 43 | class CtrlGeneric: public SkinObject, public Observer<VarBool> |
|---|
| 42 | 44 | { |
|---|
| 43 | 45 | public: |
|---|
| … | … | |
| 74 | 76 | virtual bool isFocusable() const { return false; } |
|---|
| 75 | 77 | |
|---|
| | 78 | /// Return true if the control is visible |
|---|
| | 79 | virtual bool isVisible() const; |
|---|
| | 80 | |
|---|
| 76 | 81 | 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 ); |
|---|
| 78 | 85 | |
|---|
| 79 | 86 | /// Tell the layout when the image has changed |
|---|
| … | … | |
| 96 | 103 | virtual void onPositionChange() {} |
|---|
| 97 | 104 | |
|---|
| | 105 | /// Overload this method to get notified of bool variable changes |
|---|
| | 106 | virtual void onVarBoolUpdate( VarBool &rVar ) {} |
|---|
| | 107 | |
|---|
| 98 | 108 | private: |
|---|
| 99 | 109 | /// Associated layout |
|---|
| … | … | |
| 103 | 113 | /// Help text |
|---|
| 104 | 114 | 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 ); |
|---|
| 105 | 120 | }; |
|---|
| 106 | 121 | |
|---|
| rce41dfb |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 33 | 33 | |
|---|
| 34 | 34 | CtrlImage::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 ) |
|---|
| 37 | 37 | { |
|---|
| 38 | 38 | OSFactory *pOsFactory = OSFactory::instance( pIntf ); |
|---|
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 39 | 39 | // Create an image with the given bitmap (which is NOT copied) |
|---|
| 40 | 40 | CtrlImage( intf_thread_t *pIntf, const GenericBitmap &rBitmap, |
|---|
| 41 | | const UString &rHelp ); |
|---|
| | 41 | const UString &rHelp, VarBool *pVisible ); |
|---|
| 42 | 42 | virtual ~CtrlImage(); |
|---|
| 43 | 43 | |
|---|
| r6ae1b0c |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 42 | 42 | uint32_t fgColor, uint32_t playColor, uint32_t bgColor1, |
|---|
| 43 | 43 | 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 ), |
|---|
| 46 | 46 | m_fgColor( fgColor ), m_playColor( playColor ), m_bgColor1( bgColor1 ), |
|---|
| 47 | 47 | m_bgColor2( bgColor2 ), m_selColor( selColor ), m_pLastSelected( NULL ), |
|---|
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 42 | 42 | uint32_t fgcolor, uint32_t playcolor, uint32_t bgcolor1, |
|---|
| 43 | 43 | uint32_t bgcolor2, uint32_t selColor, |
|---|
| 44 | | const UString &rHelp ); |
|---|
| | 44 | const UString &rHelp, VarBool *pVisible ); |
|---|
| 45 | 45 | virtual ~CtrlList(); |
|---|
| 46 | 46 | |
|---|
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 34 | 34 | CtrlMove::CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager, |
|---|
| 35 | 35 | 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 ), |
|---|
| 38 | 38 | m_rWindowManager( rWindowManager ), |
|---|
| 39 | 39 | m_rCtrl( rCtrl ), m_rWindow( rWindow ), |
|---|
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 40 | 40 | CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager, |
|---|
| 41 | 41 | CtrlFlat &rCtrl, GenericWindow &rWindow, |
|---|
| 42 | | const UString &rHelp ); |
|---|
| | 42 | const UString &rHelp, VarBool *pVisible ); |
|---|
| 43 | 43 | virtual ~CtrlMove() {} |
|---|
| 44 | 44 | |
|---|
| rc45fb12 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 37 | 37 | const GenericBitmap &rBmpSeq, int numImg, |
|---|
| 38 | 38 | 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 ), |
|---|
| 41 | 42 | m_rVariable( rVariable ), m_minAngle( minAngle ), m_maxAngle( maxAngle ), |
|---|
| 42 | 43 | m_cmdUpDown( this, &transUpDown ), m_cmdDownUp( this, &transDownUp ), |
|---|
| rc45fb12 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 44 | 44 | CtrlRadialSlider( intf_thread_t *pIntf, const GenericBitmap &rBmpSeq, |
|---|
| 45 | 45 | int numImg, VarPercent &rVariable, float minAngle, |
|---|
| 46 | | float maxAngle, const UString &rHelp ); |
|---|
| | 46 | float maxAngle, const UString &rHelp, |
|---|
| | 47 | VarBool *pVisible ); |
|---|
| 47 | 48 | |
|---|
| 48 | 49 | virtual ~CtrlRadialSlider(); |
|---|
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 34 | 34 | |
|---|
| 35 | 35 | CtrlResize::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 ), |
|---|
| 38 | 39 | m_rLayout( rLayout ), m_cmdResizeResize( this, &transResizeResize ), |
|---|
| 39 | 40 | m_cmdStillResize( this, &transStillResize ), |
|---|
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 38 | 38 | public: |
|---|
| 39 | 39 | CtrlResize( intf_thread_t *pIntf, CtrlFlat &rCtrl, |
|---|
| 40 | | GenericLayout &rLayout, const UString &rHelp ); |
|---|
| | 40 | GenericLayout &rLayout, const UString &rHelp, |
|---|
| | 41 | VarBool *pVisible ); |
|---|
| 41 | 42 | virtual ~CtrlResize() {} |
|---|
| 42 | 43 | |
|---|
| r675864e |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 48 | 48 | const UString &rTooltip, |
|---|
| 49 | 49 | 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 ), |
|---|
| 52 | 52 | m_width( rCurve.getWidth() ), m_height( rCurve.getHeight() ), |
|---|
| 53 | 53 | m_cmdOverDown( this, &transOverDown ), |
|---|
| … | … | |
| 92 | 92 | m_rVariable.addObserver( this ); |
|---|
| 93 | 93 | |
|---|
| 94 | | // Observe the visibility variable |
|---|
| 95 | | if( m_pVisible ) |
|---|
| 96 | | { |
|---|
| 97 | | m_pVisible->addObserver( this ); |
|---|
| 98 | | } |
|---|
| 99 | | |
|---|
| 100 | 94 | // Initial position of the cursor |
|---|
| 101 | 95 | m_lastPercentage = m_rVariable.get(); |
|---|
| … | … | |
| 106 | 100 | { |
|---|
| 107 | 101 | m_rVariable.delObserver( this ); |
|---|
| 108 | | if( m_pVisible ) |
|---|
| 109 | | { |
|---|
| 110 | | m_pVisible->delObserver( this ); |
|---|
| 111 | | } |
|---|
| 112 | 102 | SKINS_DELETE( m_pImgUp ); |
|---|
| 113 | 103 | SKINS_DELETE( m_pImgDown ); |
|---|
| … | … | |
| 151 | 141 | void CtrlSliderCursor::draw( OSGraphics &rImage, int xDest, int yDest ) |
|---|
| 152 | 142 | { |
|---|
| 153 | | if( m_pImg && (!m_pVisible || m_pVisible->get()) ) |
|---|
| | 143 | if( m_pImg ) |
|---|
| 154 | 144 | { |
|---|
| 155 | 145 | // Compute the position of the cursor |
|---|
| … | … | |
| 174 | 164 | { |
|---|
| 175 | 165 | // The position has changed |
|---|
| 176 | | notifyLayout(); |
|---|
| 177 | | } |
|---|
| 178 | | |
|---|
| 179 | | |
|---|
| 180 | | void CtrlSliderCursor::onUpdate( Subject<VarBool> &rVariable ) |
|---|
| 181 | | { |
|---|
| 182 | | // The visibility variable has changed |
|---|
| 183 | 166 | notifyLayout(); |
|---|
| 184 | 167 | } |
|---|
| … | … | |
| 321 | 304 | int thickness, VarBool *pVisible, |
|---|
| 322 | 305 | 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 ), |
|---|
| 325 | 308 | m_width( rCurve.getWidth() ), m_height( rCurve.getHeight() ) |
|---|
| 326 | 309 | { |
|---|
| … | … | |
| 330 | 313 | bool CtrlSliderBg::mouseOver( int x, int y ) const |
|---|
| 331 | 314 | { |
|---|
| 332 | | if( m_pVisible && !m_pVisible->get() ) |
|---|
| 333 | | { |
|---|
| 334 | | return false; |
|---|
| 335 | | } |
|---|
| 336 | | |
|---|
| 337 | 315 | // Compute the resize factors |
|---|
| 338 | 316 | float factorX, factorY; |
|---|
| … | … | |
| 393 | 371 | |
|---|
| 394 | 372 | |
|---|
| 395 | | void CtrlSliderBg::onUpdate( Subject<VarBool> &rVariable ) |
|---|
| 396 | | { |
|---|
| 397 | | // The visibility variable has changed |
|---|
| 398 | | notifyLayout(); |
|---|
| 399 | | } |
|---|
| 400 | | |
|---|
| 401 | | |
|---|
| 402 | 373 | void CtrlSliderBg::getResizeFactors( float &rFactorX, float &rFactorY ) const |
|---|
| 403 | 374 | { |
|---|
| rc45fb12 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 35 | 35 | class OSGraphics; |
|---|
| 36 | 36 | class VarPercent; |
|---|
| 37 | | class VarBool; |
|---|
| 38 | 37 | |
|---|
| 39 | 38 | |
|---|
| 40 | 39 | /// Cursor of a slider |
|---|
| 41 | | class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>, |
|---|
| 42 | | public Observer<VarBool> |
|---|
| | 40 | class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent> |
|---|
| 43 | 41 | { |
|---|
| 44 | 42 | public: |
|---|
| … | … | |
| 71 | 69 | /// Variable associated to the cursor |
|---|
| 72 | 70 | VarPercent &m_rVariable; |
|---|
| 73 | | /// Visibility variable |
|---|
| 74 | | VarBool *m_pVisible; |
|---|
| 75 | 71 | /// Tooltip text |
|---|
| 76 | 72 | const UString m_tooltip; |
|---|
| … | … | |
| 110 | 106 | virtual void onUpdate( Subject<VarPercent> &rVariable ); |
|---|
| 111 | 107 | |
|---|
| 112 | | /// Method called when the visibility variable is modified |
|---|
| 113 | | virtual void onUpdate( Subject<VarBool> &rVariable ); |
|---|
| 114 | | |
|---|
| 115 | 108 | /// Methode to compute the resize factors |
|---|
| 116 | 109 | void getResizeFactors( float &rFactorX, float &rFactorY ) const; |
|---|
| … | … | |
| 122 | 115 | { |
|---|
| 123 | 116 | public: |
|---|
| 124 | | /// If pVisible is NULL, the control is always visible |
|---|
| 125 | 117 | CtrlSliderBg( intf_thread_t *pIntf, CtrlSliderCursor &rCursor, |
|---|
| 126 | 118 | const Bezier &rCurve, VarPercent &rVariable, |
|---|
| … | … | |
| 141 | 133 | /// Thickness of the curve |
|---|
| 142 | 134 | int m_thickness; |
|---|
| 143 | | /// Visibility variable |
|---|
| 144 | | VarBool *m_pVisible; |
|---|
| 145 | 135 | /// Bezier curve of the slider |
|---|
| 146 | 136 | const Bezier m_curve; |
|---|
| … | … | |
| 150 | 140 | /// Methode to compute the resize factors |
|---|
| 151 | 141 | void getResizeFactors( float &rFactorX, float &rFactorY ) const; |
|---|
| 152 | | |
|---|
| 153 | | /// Method called when the visibility variable is modified |
|---|
| 154 | | virtual void onUpdate( Subject<VarBool> &rVariable ); |
|---|
| 155 | 142 | }; |
|---|
| 156 | 143 | |
|---|
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 43 | 43 | CtrlText::CtrlText( intf_thread_t *pIntf, VarText &rVariable, |
|---|
| 44 | 44 | 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 ), |
|---|
| 48 | 48 | m_cmdManualMoving( this, &transManualMoving ), |
|---|
| 49 | 49 | m_cmdManualStill( this, &transManualStill ), |
|---|
| rb7dc5e8 |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 45 | 45 | CtrlText( intf_thread_t *pIntf, VarText &rVariable, |
|---|
| 46 | 46 | const GenericFont &rFont, const UString &rHelp, |
|---|
| 47 | | uint32_t color = 0 ); |
|---|
| | 47 | uint32_t color, VarBool *pVisible ); |
|---|
| 48 | 48 | virtual ~CtrlText(); |
|---|
| 49 | 49 | |
|---|
| r6ae1b0c |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 217 | 217 | CtrlButton *pButton = new CtrlButton( getIntf(), *pBmpUp, *pBmpOver, |
|---|
| 218 | 218 | *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 ); |
|---|
| 220 | 220 | |
|---|
| 221 | 221 | // Compute the position of the control |
|---|
| … | … | |
| 288 | 288 | *pCommand2, UString( getIntf(), rData.m_tooltip1.c_str() ), |
|---|
| 289 | 289 | 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 ); |
|---|
| 291 | 291 | |
|---|
| 292 | 292 | // Compute the position of the control |
|---|
| … | … | |
| 323 | 323 | |
|---|
| 324 | 324 | CtrlImage *pImage = new CtrlImage( getIntf(), *pBmp, |
|---|
| 325 | | UString( getIntf(), rData.m_help.c_str() ) ); |
|---|
| | 325 | UString( getIntf(), rData.m_help.c_str() ), |
|---|
| | 326 | NULL); |
|---|
| 326 | 327 | |
|---|
| 327 | 328 | // Compute the position of the control |
|---|
| … | … | |
| 335 | 336 | { |
|---|
| 336 | 337 | 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); |
|---|
| 338 | 340 | pLayout->addControl( pMove, pos, rData.m_layer ); |
|---|
| 339 | 341 | } |
|---|
| … | … | |
| 341 | 343 | { |
|---|
| 342 | 344 | CtrlResize *pResize = new CtrlResize( getIntf(), *pImage, *pLayout, |
|---|
| 343 | | UString( getIntf(), rData.m_help.c_str() ) ); |
|---|
| | 345 | UString( getIntf(), rData.m_help.c_str() ), NULL ); |
|---|
| 344 | 346 | pLayout->addControl( pResize, pos, rData.m_layer ); |
|---|
| 345 | 347 | } |
|---|
| … | … | |
| 376 | 378 | |
|---|
| 377 | 379 | 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 ); |
|---|
| 379 | 381 | |
|---|
| 380 | 382 | int height = pFont->getSize(); |
|---|
| … | … | |
| 415 | 417 | new CtrlRadialSlider( getIntf(), *pSeq, rData.m_nbImages, *pVar, |
|---|
| 416 | 418 | rData.m_minAngle, rData.m_maxAngle, |
|---|
| 417 | | UString( getIntf(), rData.m_help.c_str() ) ); |
|---|
| | 419 | UString( getIntf(), rData.m_help.c_str() ), |
|---|
| | 420 | NULL ); |
|---|
| 418 | 421 | |
|---|
| 419 | 422 | // XXX: resizing is not supported |
|---|
| … | … | |
| 525 | 528 | rData.m_fgColor, rData.m_playColor, rData.m_bgColor1, |
|---|
| 526 | 529 | rData.m_bgColor2, rData.m_selColor, |
|---|
| 527 | | UString( getIntf(), rData.m_help.c_str() ) ); |
|---|
| | 530 | UString( getIntf(), rData.m_help.c_str() ), NULL ); |
|---|
| 528 | 531 | |
|---|
| 529 | 532 | // Compute the position of the control |
|---|
| r181e921 |
ra2ce62f |
|
| 8 | 8 | 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 |
|---|
| 9 | 9 | 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 |
|---|
| 10 | | Text id:string xPos:int yPos:int fontId:string text:string width:int help:string layer:int windowId:string layoutId:string |
|---|
| | 10 | Text id:string xPos:int yPos:int fontId:string text:string width:int color:uint32_t help:string layer:int windowId:string layoutId:string |
|---|
| 11 | 11 | 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 |
|---|
| 12 | 12 | 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 |
|---|
| r6ae1b0c |
ra2ce62f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 29 | 29 | #define BUILDER_DATA_HPP |
|---|
| 30 | 30 | |
|---|
| | 31 | using namespace std; |
|---|
| | 32 | |
|---|
| 31 | 33 | #include <vlc/vlc.h> |
|---|
| 32 | 34 | #include <list> |
|---|
| | 35 | #include <map> |
|---|
| 33 | 36 | #include <string> |
|---|
| 34 | | |
|---|
| 35 | | using namespace std; |
|---|
| 36 | 37 | |
|---|
| 37 | 38 | /// Structure for mapping data from XML file |
|---|
| … | … | |
| 207 | 208 | struct Text |
|---|
| 208 | 209 | { |
|---|
| 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 ): |
|---|
| | 211 | 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 ) {} |
|---|
| 211 | 212 | |
|---|
| 212 | 213 | const string m_id; |
|---|
| … | … | |
| 216 | 217 | const string m_text; |
|---|
| 217 | 218 | int m_width; |
|---|
| | 219 | uint32_t m_color; |
|---|
| 218 | 220 | const string m_help; |
|---|
| 219 | 221 | int m_layer; |
|---|