BsEditorWindowManager.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsEditorPrerequisites.h"
  5. #include "BsModule.h"
  6. #include "BsEvent.h"
  7. namespace BansheeEngine
  8. {
  9. /** @addtogroup EditorWindow-Internal
  10. * @{
  11. */
  12. /** Manages that handles creation, destruction and updates of editor windows. */
  13. class BS_ED_EXPORT EditorWindowManager : public Module<EditorWindowManager>
  14. {
  15. public:
  16. EditorWindowManager();
  17. ~EditorWindowManager();
  18. /**
  19. * Creates the main editor window using a previously created render window. If a main window already exists, this
  20. * will return the existing instance.
  21. */
  22. MainEditorWindow* createMain(const SPtr<RenderWindow>& parentRenderWindow);
  23. /** Creates a new editor window. There is no limit on the number of editor windows. */
  24. EditorWindow* create();
  25. /** Notifies the manager that a new editor window was created. */
  26. void registerWindow(EditorWindowBase* window);
  27. /** Schedules the window for destruction. Actual destruction will happen on next update. */
  28. void destroy(EditorWindowBase* window);
  29. /** Returns the main editor window, or null if one doesn't exist. */
  30. MainEditorWindow* getMainWindow() const { return mMainWindow; }
  31. /** Update to be called once per frame. Calls update on all active editor windows. */
  32. void update();
  33. /** Checks if any editor window has keyboard focus. */
  34. bool hasFocus() const;
  35. protected:
  36. MainEditorWindow* mMainWindow;
  37. Vector<EditorWindowBase*> mEditorWindows;
  38. Vector<EditorWindowBase*> mScheduledForDestruction;
  39. Vector<EditorWindowBase*> mEditorWindowsSnapshot;
  40. };
  41. /** @} */
  42. }