]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/controls/ctrl_checkbox.hpp
* all: new handling of vout controls to allow serveral layouts/windows
[vlc] / modules / gui / skins2 / controls / ctrl_checkbox.hpp
index 3f49814ca1d837c1515ce67de00eed1afb8e63f3..10eeefc0b911fefa5eb66adc22d1c4c8fae29b18 100644 (file)
@@ -5,7 +5,7 @@
  * $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
@@ -19,7 +19,7 @@
  *
  * 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.
  *****************************************************************************/
 
 #ifndef CTRL_CHECKBOX_HPP
@@ -28,6 +28,7 @@
 #include "ctrl_generic.hpp"
 #include "../utils/fsm.hpp"
 #include "../utils/observer.hpp"
+#include "../src/anim_bitmap.hpp"
 
 class GenericBitmap;
 class OSGraphics;
@@ -35,7 +36,7 @@ class CmdGeneric;
 
 
 /// Base class for checkbox controls
-class CtrlCheckbox: public CtrlGeneric
+class CtrlCheckbox: public CtrlGeneric, public Observer<AnimBitmap, void*>
 {
     public:
         /// Create a checkbox with 6 images
@@ -82,16 +83,16 @@ class CtrlCheckbox: public CtrlGeneric
         /// Current tooltip
         const UString *m_pTooltip;
          /// Images of the checkbox in the different states
-        OSGraphics *m_pImgUp1, *m_pImgOver1, *m_pImgDown1;
-        OSGraphics *m_pImgUp2, *m_pImgOver2, *m_pImgDown2;
+        AnimBitmap m_imgUp1, m_imgOver1, m_imgDown1;
+        AnimBitmap m_imgUp2, m_imgOver2, m_imgDown2;
         /// Current set of images (pointing to 1 or 2)
         /// In fact, we consider here that a checkbox acts like 2 buttons, in a
         /// symetric way; this is a small trick to avoid multiplicating the
         /// callbacks (and it could be extended easily to support 3 buttons or
         /// more...)
-        OSGraphics *m_pImgUp, *m_pImgOver, *m_pImgDown;
+        AnimBitmap *m_pImgUp, *m_pImgOver, *m_pImgDown;
         /// Current image
-        OSGraphics *m_pImgCurrent;
+        AnimBitmap *m_pImgCurrent;
 
         /// Callback objects
         DEFINE_CALLBACK( CtrlCheckbox, UpOverDownOver )
@@ -107,6 +108,12 @@ class CtrlCheckbox: public CtrlGeneric
         /// Method called when the observed variable is modified
         virtual void onVarBoolUpdate( VarBool &rVariable );
 
+        /// Method called when an animated bitmap changes
+        virtual void onUpdate( Subject<AnimBitmap, void*> &rBitmap, void* );
+
+        /// Change the current image
+        void setImage( AnimBitmap *pImg );
+
         /// Helper function to update the current state of images
         void changeButton();
 };