00001 // Filename: chanlayout.h 00002 // Created by: cary (04Feb99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef __CHANLAYOUT_H__ 00020 #define __CHANLAYOUT_H__ 00021 00022 #include <pandabase.h> 00023 00024 #include "pmap.h" 00025 #include "pvector.h" 00026 #include <algorithm> 00027 #include <string> 00028 #include "chanviewport.h" 00029 00030 00031 typedef pvector<ChanViewport> LayoutRegionVec; 00032 00033 class LayoutItem { 00034 private: 00035 int _x, _y; 00036 LayoutRegionVec _regions; 00037 public: 00038 INLINE LayoutItem(void); 00039 INLINE LayoutItem(int, int); 00040 INLINE LayoutItem(const LayoutItem&); 00041 INLINE ~LayoutItem(void); 00042 00043 INLINE LayoutItem& operator=(const LayoutItem&); 00044 INLINE void AddRegion(const ChanViewport&); 00045 INLINE int GetNumRegions(void); 00046 INLINE const ChanViewport& operator[](int); 00047 }; 00048 00049 typedef pmap<std::string, LayoutItem> LayoutType; 00050 00051 extern LayoutType* LayoutDB; 00052 00053 void ResetLayout(); 00054 void ParseLayout(istream&); 00055 00056 #include "chanlayout.I" 00057 00058 #endif /* __CHANLAYOUT_H__ */