Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgreOverlayManager.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://ogre.sourceforge.net/
00006 
00007 Copyright © 2000-2002 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 #ifndef __OverlayManager_H__
00026 #define __OverlayManager_H__
00027 
00028 #include "OgrePrerequisites.h"
00029 #include "OgreResourceManager.h"
00030 #include "OgreSingleton.h"
00031 #include "OgreEventDispatcher.h"
00032 #include "OgreTargetManager.h"
00033 
00034 namespace Ogre {
00035 
00039     class _OgreExport OverlayManager : public ResourceManager, public Singleton<OverlayManager>, public TargetManager
00040     {
00041     protected:
00042         GuiContainer* mCursorGuiRegistered;
00043         MouseMotionListener* mCursorListener;
00044         Overlay* mCursorLevelOverlay;
00045         void parseNewElement( DataChunk& chunk, String& elemType, String& elemName, 
00046             bool isContainer, Overlay* pOverlay, bool isTemplate, String templateName = String(""), GuiContainer* container = 0);
00047         void parseAttrib( const String& line, Overlay* pOverlay);
00048         void parseElementAttrib( const String& line, Overlay* pOverlay, GuiElement* pElement );
00049         void parseNewMesh(DataChunk& chunk, String& meshName, String& entityName, Overlay* pOverlay);
00050         void skipToNextCloseBrace(DataChunk& chunk);
00051         void skipToNextOpenBrace(DataChunk& chunk);
00052         
00053         int mLastViewportWidth, mLastViewportHeight;
00054         bool mViewportDimensionsChanged;
00055 
00056 //      void dispatchEvent(InputEvent* e, 
00057 
00058         bool parseChildren( DataChunk& chunk, const String& line,
00059             Overlay* pOverlay, bool isTemplate, GuiContainer* parent = NULL);
00060 
00061     public:
00062         OverlayManager();
00063         virtual ~OverlayManager();
00064 
00066         void parseOverlayFile(DataChunk& chunk);
00068         void parseAllSources(const String& extension = ".overlay");
00069 
00070 
00072         virtual Resource* create( const String& name);
00073 
00075         void _queueOverlaysForRendering(Camera* cam, RenderQueue* pQueue, Viewport *vp);
00076 
00081         bool hasViewportChanged(void);
00082 
00084         int getViewportHeight(void);
00085         
00087         int getViewportWidth(void);
00088 
00098         static OverlayManager& getSingleton(void);
00099 
00100 
00102         PositionTarget* getPositionTargetAt(Real x, Real y);
00103 
00105         void setCursorGui(GuiContainer* cursor, MouseMotionListener* cursorListener);
00106 
00108         GuiContainer* getCursorGui();
00109 
00111         void createCursorOverlay();
00112     };
00113 
00114 
00115 
00116 }
00117 
00118 
00119 #endif 

Copyright © 2002 by The OGRE Team