FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
librocketmanager.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2017 by the FIFE team *
3  * http://www.fifengine.net *
4  * This file is part of FIFE. *
5  * *
6  * FIFE is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU Lesser General Public *
8  * License as published by the Free Software Foundation; either *
9  * version 2.1 of the License, or (at your option) any later version. *
10  * *
11  * This library is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20  ***************************************************************************/
21 
22 #ifndef FIFE_GUI_LIBROCKETMANAGER_H
23 #define FIFE_GUI_LIBROCKETMANAGER_H
24 
25 // Standard C++ library includes
26 #include <map>
27 #include <string>
28 
29 // 3rd party library includes
30 #include <Rocket/Core/SystemInterface.h>
31 
32 // FIFE includes
33 // These includes are split up in two parts, separated by one empty line
34 // First block: files included from the FIFE root src directory
35 // Second block: files included from the same folder
36 #include "util/base/singleton.h"
37 #include "gui/guimanager.h"
38 
39 namespace Rocket {
40 
41  namespace Core {
42  class Context;
43  class ElementDocument;
44  }
45 };
46 
47 namespace FIFE {
48 
49  class LibRocketInputProcessor;
50  class LibRocketRenderInterface;
51 
53  public Rocket::Core::SystemInterface,
54  public IGUIManager,
55  public DynamicSingleton<LibRocketManager> {
56 
57  public:
58 
62 
66  virtual ~LibRocketManager();
67 
71  void init(const std::string& backend, int32_t screenWidth, int32_t screenHeight);
72 
81  virtual float GetElapsedTime();
82 
85  virtual void turn();
86 
94  virtual void resizeTopContainer(uint32_t x, uint32_t y, uint32_t width, uint32_t height);
95 
102  virtual Rocket::Core::ElementDocument* loadDocument(const std::string& id, const std::string& documentPath);
103 
106  virtual Rocket::Core::ElementDocument* getDocument(const std::string& id);
107 
110  virtual void unloadDocument(Rocket::Core::ElementDocument* document);
111 
114  virtual void unloadDocument(const std::string& id);
115 
121  virtual void loadFont(const std::string& filepath);
122 
126  virtual bool onSdlEvent(SDL_Event& evt);
127 
130  void showDebugger() const;
131 
135  void hideDebugger() const;
136 
137  private:
138 
142  void unloadDocuments();
143 
146  Rocket::Core::Context* m_context;
147 
151 
155 
158  std::map<std::string, Rocket::Core::ElementDocument*> m_openDocuments;
159 
160  };
161 };
162 
163 #endif //FIFE_GUI_LIBROCKETMANAGER_H
LibRocketInputProcessor * m_inputProcessor
Input processor for librocket.
std::map< std::string, Rocket::Core::ElementDocument * > m_openDocuments
A set of all open documents.
LibRocketRenderInterface * m_renderInterface
Render Interface for librocket.
Another Singleton.
Definition: singleton.h:82
Rocket::Core::Context * m_context
Librocket&#39;s context.
unsigned int uint32_t
Definition: core.h:40