Gnash  0.8.10
DisplayObjectContainer.h
Go to the documentation of this file.
00001 // DisplayObjectContainer.h: Container of DisplayObjects.
00002 // 
00003 //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
00004 //   Free Software Foundation, Inc
00005 // 
00006 // This program is free software; you can redistribute it and/or modify
00007 // it under the terms of the GNU General Public License as published by
00008 // the Free Software Foundation; either version 3 of the License, or
00009 // (at your option) any later version.
00010 // 
00011 // This program is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License for more details.
00015 // 
00016 // You should have received a copy of the GNU General Public License
00017 // along with this program; if not, write to the Free Software
00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019 
00020 // Stateful live Sprite instance
00021 
00022 #ifndef GNASH_DISPLAYOBJECTCONTAINER_H
00023 #define GNASH_DISPLAYOBJECTCONTAINER_H
00024 
00025 #ifdef HAVE_CONFIG_H
00026 #include "gnashconfig.h" 
00027 #endif
00028 
00029 #include "DisplayList.h" 
00030 #include "InteractiveObject.h"
00031 
00032 #ifdef USE_SWFTREE
00033 # include "tree.hh"
00034 #endif
00035 
00036 // Forward declarations
00037 namespace gnash {
00038 }
00039 
00040 namespace gnash {
00041 
00042 class DisplayObjectContainer : public InteractiveObject 
00043 {
00044 
00045 public:
00046     
00047     DisplayObjectContainer(as_object* object, DisplayObject* parent)
00048         :
00049         InteractiveObject(object, parent)
00050     {
00051         assert(object);
00052     }
00053 
00054     virtual ~DisplayObjectContainer();
00055 
00056     size_t numChildren() const {
00057         return _displayList.size();
00058     }
00059 
00060 #ifdef USE_SWFTREE
00061     // Override to append display list info, see dox in DisplayObject.h
00062     virtual InfoTree::iterator getMovieInfo(InfoTree& tr,
00063             InfoTree::iterator it);
00064 #endif
00065     
00066 
00067 protected:
00068 
00069     // TODO: make private and move all DisplayList functions to this class.
00070     DisplayList _displayList;
00071 
00072 };
00073 
00074 } // namespace gnash
00075 
00076 #endif