|
|
|
|
/******************************************************************************
|
|
|
|
|
* File - panel_manager.h
|
|
|
|
|
* Author - Joey Pollack
|
|
|
|
|
* Date - 2022/02/07 (y/m/d)
|
|
|
|
|
* Mod Date - 2022/02/07 (y/m/d)
|
|
|
|
|
* Description - Manage the editor panels
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef PANEL_MANAGER_H_
|
|
|
|
|
#define PANEL_MANAGER_H_
|
|
|
|
|
|
|
|
|
|
#include <utils/opRes.h>
|
|
|
|
|
#include <gui/dearimgui/imgui.h>
|
|
|
|
|
#include <gui/panel.h>
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
|
|
struct ImGuiWindowClass;
|
|
|
|
|
|
|
|
|
|
namespace lunarium{
|
|
|
|
|
class IGraphics;
|
|
|
|
|
namespace editor
|
|
|
|
|
{
|
|
|
|
|
class Editor;
|
|
|
|
|
class PanelManager
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
PanelManager();
|
|
|
|
|
OpRes Initialize(Editor* editor, std::string name);
|
|
|
|
|
void Shutdown();
|
|
|
|
|
|
|
|
|
|
OpRes AddPanel(gui::PanelType type, gui::Panel* panel);
|
|
|
|
|
void OpenPanel(gui::PanelType type);
|
|
|
|
|
void ClosePanel(gui::PanelType type);
|
|
|
|
|
bool IsOpen(gui::PanelType type);
|
|
|
|
|
gui::Panel* GetPanel(gui::PanelType type);
|
|
|
|
|
const ImGuiWindowClass* GetWindowClass() const;
|
|
|
|
|
|
|
|
|
|
void ResetDocking();
|
|
|
|
|
|
|
|
|
|
void OnTick(double delta);
|
|
|
|
|
void OnRender(lunarium::IGraphics* g);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Editor* mpEditor;
|
|
|
|
|
std::string mName;
|
|
|
|
|
bool mResetDockSpace;
|
|
|
|
|
std::map<gui::PanelType, gui::Panel*> mPanels;
|
|
|
|
|
unsigned int mDockSpaceID;
|
|
|
|
|
ImGuiWindowClass mWindowClass;
|
|
|
|
|
std::map<gui::PanelDockZone, unsigned int> mDockZoneIDs;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void DestoryPanels();
|
|
|
|
|
|
|
|
|
|
void MakeDockSpaces();
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
|
|
#endif // PANEL_MANAGER_H_
|