]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/src/generic_layout.hpp
* scaled_bitmap.cpp: - fixed an infinite loop when width=1
[vlc] / modules / gui / skins2 / src / generic_layout.hpp
index 3fdc8367bb27ce91a3fe0b9a2e20f196f787c950..0f3066d1450998018a5030e6c01117a19ec669a6 100644 (file)
@@ -35,6 +35,8 @@
 class Anchor;
 class OSGraphics;
 class CtrlGeneric;
+class CtrlVideo;
+class VarBoolImpl;
 
 
 /// Control and its associated layer
@@ -98,8 +100,10 @@ class GenericLayout: public SkinObject, public Box
         /// Resize the layout
         virtual void resize( int width, int height );
 
-        /// Add a control in the layout at the given position, and
-        /// the optional given layer
+        /**
+         * Add a control in the layout at the given position, and
+         * the optional given layer
+         */
         virtual void addControl( CtrlGeneric *pControl,
                                  const Position &rPosition,
                                  int layer );
@@ -108,9 +112,11 @@ class GenericLayout: public SkinObject, public Box
         virtual const list<LayeredControl> &getControlList() const;
 
         /// Called by a control when its image has changed
-        /// The arguments indicate the size of the rectangle to refresh,
-        /// and the offset (from the control position) of this rectangle.
-        /// Use a negative width or height to refresh the layout completely
+        /**
+         * The arguments indicate the size of the rectangle to refresh,
+         * and the offset (from the control position) of this rectangle.
+         * Use a negative width or height to refresh the layout completely
+         */
         virtual void onControlUpdate( const CtrlGeneric &rCtrl,
                                       int width, int height,
                                       int xOffSet, int yOffSet );
@@ -121,6 +127,16 @@ class GenericLayout: public SkinObject, public Box
         /// Add an anchor to this layout
         virtual void addAnchor( Anchor *pAnchor );
 
+        /// Called when the layout is shown
+        virtual void onShow();
+
+        /// Called when the layout is hidden
+        virtual void onHide();
+
+        /// Give access to the "active layout" variable
+        // FIXME: we give read/write access
+        VarBoolImpl &getActiveVar() { return *m_pVarActive; }
+
     private:
         /// Parent window of the layout
         TopWindow *m_pWindow;
@@ -132,8 +148,19 @@ class GenericLayout: public SkinObject, public Box
         OSGraphics *m_pImage;
         /// List of the controls in the layout
         list<LayeredControl> m_controlList;
+        //// Video control
+        CtrlVideo *m_pVideoControl;
         /// List of the anchors in the layout
         list<Anchor*> m_anchorList;
+        /// Flag to know if the layout is visible
+        bool m_visible;
+        /// Variable for the "active state" of the layout
+        /**
+         * Note: the layout is not an observer on this variable, because it
+         * cannot be changed externally (i.e. without an explicit change of
+         * layout). This way, we avoid using a setActiveLayoutInner method.
+         */
+        mutable VarBoolImpl *m_pVarActive;
 };