ZList.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 /* GG is a GUI for SDL and OpenGL.
00003    Copyright (C) 2003 T. Zachary Laine
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public License
00007    as published by the Free Software Foundation; either version 2.1
00008    of the License, or (at your option) any later version.
00009    
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014     
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with this library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA
00019 
00020    If you do not wish to comply with the terms of the LGPL please
00021    contact the author as other terms are available for a fee.
00022     
00023    Zach Laine
00024    whatwasthataddress@hotmail.com */
00025 
00029 #ifndef _GG_ZList_h_
00030 #define _GG_ZList_h_
00031 
00032 #include <GG/Base.h>
00033 
00034 #include <list>
00035 #include <set>
00036 
00037 
00038 namespace GG {
00039     class Wnd;
00040 
00046 class GG_API ZList : public std::list<Wnd*>
00047 {
00048 public: 
00050 
00051     Wnd* Pick(const Pt& pt, Wnd* modal, Wnd* ignore = 0) const;
00053  
00055 
00058     void Add(Wnd* wnd);
00059     bool Remove(Wnd* wnd);   
00060     bool MoveUp(Wnd* wnd);   
00061     bool MoveDown(Wnd* wnd); 
00062 
00063 
00064 private:
00065     Wnd*     PickWithinWindow(const Pt& pt, Wnd* wnd, Wnd* ignore) const; 
00066     bool     NeedsRealignment() const;     
00067     void     Realign();                    
00068     iterator FirstNonOnTop();              
00069 
00070     std::set<Wnd*> m_contents; 
00071 };
00072 
00073 } // namespace GG
00074 
00075 #endif // _GG_ZList_h_

Generated on Wed Mar 26 14:35:42 2008 for GG by  doxygen 1.5.2