/*****************************************************************************
* ctrl_generic.cpp
*****************************************************************************
- * Copyright (C) 2003 VideoLAN
- * $Id: ctrl_generic.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp $
+ * Copyright (C) 2003 the VideoLAN team
+ * $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
- * Olivier Teulière <ipkiss@via.ecp.fr>
+ * Olivier Teulière <ipkiss@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "ctrl_generic.hpp"
#include "../src/generic_layout.hpp"
-#include "../src/generic_window.hpp"
+#include "../src/top_window.hpp"
#include "../src/os_graphics.hpp"
#include "../utils/position.hpp"
#include "../utils/var_bool.hpp"
}
-void CtrlGeneric::notifyLayout() const
+void CtrlGeneric::notifyLayout( int width, int height,
+ int xOffSet, int yOffSet ) const
{
// Notify the layout
if( m_pLayout )
{
- m_pLayout->onControlUpdate( *this );
+ m_pLayout->onControlUpdate( *this, width, height, xOffSet, yOffSet );
+ }
+}
+
+
+void CtrlGeneric::notifyLayoutMaxSize( const Box *pImg1, const Box *pImg2 )
+{
+ if( pImg1 == NULL )
+ {
+ if( pImg2 == NULL )
+ {
+ notifyLayout();
+ }
+ else
+ {
+ notifyLayout( pImg2->getWidth(), pImg2->getHeight() );
+ }
+ }
+ else
+ {
+ if( pImg2 == NULL )
+ {
+ notifyLayout( pImg1->getWidth(), pImg1->getHeight() );
+ }
+ else
+ {
+ notifyLayout( max( pImg1->getWidth(), pImg2->getWidth() ),
+ max( pImg1->getHeight(), pImg2->getHeight() ) );
+ }
}
}
void CtrlGeneric::notifyTooltipChange() const
{
- GenericWindow *pWin = getWindow();
+ TopWindow *pWin = getWindow();
if( pWin )
{
// Notify the window
}
-GenericWindow *CtrlGeneric::getWindow() const
+TopWindow *CtrlGeneric::getWindow() const
{
if( m_pLayout )
{
}
-void CtrlGeneric::onUpdate( Subject<VarBool> &rVariable )
+void CtrlGeneric::onUpdate( Subject<VarBool, void*> &rVariable, void *arg )
{
- // Is it the visibily variable ?
+ // Is it the visibility variable ?
if( &rVariable == m_pVisible )
{
// Redraw the layout