]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/controls/ctrl_generic.cpp
Uniformize source files encoding
[vlc] / modules / gui / skins2 / controls / ctrl_generic.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 5ddd032..60940d1
@@ -1,11 +1,11 @@
 /*****************************************************************************
  * 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"
@@ -69,12 +69,41 @@ void CtrlGeneric::setLayout( GenericLayout *pLayout,
 }
 
 
-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() ) );
+        }
     }
 }
 
@@ -101,7 +130,7 @@ void CtrlGeneric::releaseMouse() const
 
 void CtrlGeneric::notifyTooltipChange() const
 {
-    GenericWindow *pWin = getWindow();
+    TopWindow *pWin = getWindow();
     if( pWin )
     {
         // Notify the window
@@ -110,7 +139,7 @@ void CtrlGeneric::notifyTooltipChange() const
 }
 
 
-GenericWindow *CtrlGeneric::getWindow() const
+TopWindow *CtrlGeneric::getWindow() const
 {
     if( m_pLayout )
     {
@@ -126,9 +155,9 @@ bool CtrlGeneric::isVisible() const
 }
 
 
-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