Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

generic_layout.hpp

00001 /*****************************************************************************
00002  * generic_layout.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: generic_layout.hpp 11664 2005-07-09 06:17:09Z courmisch $
00006  *
00007  * Authors: Cyril Deguet     <[email protected]>
00008  *          Olivier Teulière <[email protected]>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef GENERIC_LAYOUT_HPP
00026 #define GENERIC_LAYOUT_HPP
00027 
00028 #include "skin_common.hpp"
00029 #include "top_window.hpp"
00030 #include "../utils/pointer.hpp"
00031 #include "../utils/position.hpp"
00032 
00033 #include <list>
00034 
00035 class Anchor;
00036 class OSGraphics;
00037 class CtrlGeneric;
00038 
00039 
00041 struct LayeredControl
00042 {
00043     LayeredControl( CtrlGeneric *pControl, int layer ):
00044         m_pControl( pControl ), m_layer( layer ) {}
00045 
00047     CtrlGeneric *m_pControl;
00049     int m_layer;
00050 };
00051 
00052 
00054 class GenericLayout: public SkinObject, public Box
00055 {
00056     public:
00057         GenericLayout( intf_thread_t *pIntf, int width, int height,
00058                        int minWidth, int maxWidth, int minHeight,
00059                        int maxHeight );
00060 
00061         virtual ~GenericLayout();
00062 
00064         virtual void setWindow( TopWindow *pWindow );
00065 
00067         virtual TopWindow *getWindow() const { return m_pWindow; }
00068 
00070         virtual void onControlCapture( const CtrlGeneric &rCtrl );
00071 
00073         virtual void onControlRelease( const CtrlGeneric &rCtrl );
00074 
00076         virtual void refreshAll();
00077 
00079         virtual void refreshRect( int x, int y, int width, int height );
00080 
00082         virtual OSGraphics *getImage() const { return m_pImage; }
00083 
00085         virtual int getLeft() const { return m_pWindow->getLeft(); }
00086         virtual int getTop() const { return m_pWindow->getTop(); }
00087 
00089         virtual int getWidth() const { return m_width; }
00090         virtual int getHeight() const { return m_height; }
00091 
00093         virtual int getMinWidth() const { return m_minWidth; }
00094         virtual int getMaxWidth() const { return m_maxWidth; }
00095         virtual int getMinHeight() const { return m_minHeight; }
00096         virtual int getMaxHeight() const { return m_maxHeight; }
00097 
00099         virtual void resize( int width, int height );
00100 
00103         virtual void addControl( CtrlGeneric *pControl,
00104                                  const Position &rPosition,
00105                                  int layer );
00106 
00108         virtual const list<LayeredControl> &getControlList() const;
00109 
00114         virtual void onControlUpdate( const CtrlGeneric &rCtrl,
00115                                       int width, int height,
00116                                       int xOffSet, int yOffSet );
00117 
00119         virtual const list<Anchor*>& getAnchorList() const;
00120 
00122         virtual void addAnchor( Anchor *pAnchor );
00123 
00124     private:
00126         TopWindow *m_pWindow;
00128         int m_width, m_height;
00129         int m_minWidth, m_maxWidth;
00130         int m_minHeight, m_maxHeight;
00132         OSGraphics *m_pImage;
00134         list<LayeredControl> m_controlList;
00136         list<Anchor*> m_anchorList;
00137 };
00138 
00139 
00140 typedef CountedPtr<GenericLayout> GenericLayoutPtr;
00141 
00142 
00143 #endif

Generated on Tue Dec 20 10:14:42 2005 for vlc-0.8.4a by  doxygen 1.4.2