GG

ZList.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 /* GG is a GUI for SDL and OpenGL.
00003    Copyright (C) 2003-2008 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@gmail.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 
00050 class GG_API ZList : public std::list<Wnd*>
00051 {
00052 public: 
00054 
00056     Wnd* Pick(const Pt& pt, Wnd* modal, const std::set<Wnd*>* ignore = 0) const;
00058  
00060 
00064     void Add(Wnd* wnd);
00065 
00066     bool Remove(Wnd* wnd);   
00067 
00070     bool MoveUp(Wnd* wnd);
00071 
00074     bool MoveDown(Wnd* wnd);
00076 
00077 private:
00078     Wnd*     PickWithinWindow(const Pt& pt, Wnd* wnd, const std::set<Wnd*>* ignore) const; 
00079     bool     NeedsRealignment() const;     
00080     void     Realign();                    
00081     iterator FirstNonOnTop();              
00082 
00083     std::set<Wnd*> m_contents; 
00084 };
00085 
00086 } // namespace GG
00087 
00088 #endif // _GG_ZList_h_