2011-08-14 04:09:11 +02:00
|
|
|
#ifndef UIMANAGER_H
|
|
|
|
#define UIMANAGER_H
|
|
|
|
|
2011-08-15 16:06:15 +02:00
|
|
|
#include "declarations.h"
|
|
|
|
#include <framework/platform/platformevent.h>
|
|
|
|
#include <framework/otml/declarations.h>
|
2011-08-14 04:09:11 +02:00
|
|
|
|
|
|
|
class UIManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void init();
|
|
|
|
void terminate();
|
|
|
|
|
|
|
|
void render();
|
|
|
|
void resize(const Size& size);
|
2011-08-15 21:15:49 +02:00
|
|
|
void inputEvent(const PlatformEvent& event);
|
2011-08-14 04:09:11 +02:00
|
|
|
|
|
|
|
bool importStyles(const std::string& file);
|
|
|
|
void importStyleFromOTML(const OTMLNodePtr& styleNode);
|
|
|
|
OTMLNodePtr getStyle(const std::string& styleName);
|
|
|
|
|
|
|
|
UIWidgetPtr loadUI(const std::string& file);
|
|
|
|
UIWidgetPtr loadWidgetFromOTML(const OTMLNodePtr& widgetNode);
|
|
|
|
|
|
|
|
UIWidgetPtr getRootWidget() { return m_rootWidget; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
UIWidgetPtr m_rootWidget;
|
|
|
|
std::map<std::string, OTMLNodePtr> m_styles;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern UIManager g_ui;
|
|
|
|
|
|
|
|
#endif
|