| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #pragma once
- #include "BsEditorPrerequisites.h"
- #include "Utility/BsModule.h"
- #include "Utility/BsEvent.h"
- namespace bs
- {
- /** @addtogroup EditorWindow-Internal
- * @{
- */
- /** Manages that handles creation, destruction and updates of editor windows. */
- class BS_ED_EXPORT EditorWindowManager : public Module<EditorWindowManager>
- {
- public:
- EditorWindowManager();
- ~EditorWindowManager();
- /**
- * Creates the main editor window using a previously created render window. If a main window already exists, this
- * will return the existing instance.
- */
- MainEditorWindow* createMain(const SPtr<RenderWindow>& parentRenderWindow);
- /** Creates a new editor window. There is no limit on the number of editor windows. */
- EditorWindow* create();
- /** Notifies the manager that a new editor window was created. */
- void registerWindow(EditorWindowBase* window);
- /** Schedules the window for destruction. Actual destruction will happen on next update. */
- void destroy(EditorWindowBase* window);
- /** Returns the main editor window, or null if one doesn't exist. */
- MainEditorWindow* getMainWindow() const { return mMainWindow; }
- /** Update to be called once per frame. Calls update on all active editor windows. */
- void update();
- /** Checks if any editor window has keyboard focus. */
- bool hasFocus() const;
- /**
- * By default all windows are created as hidden. After this method is called all windows will be shown, and
- * any new windows will be shown by default.
- */
- void showWindows();
- /** Checks if new editor windows should be created hidden. */
- bool areNewWindowsHidden() const { return mNewWindowsHidden; }
- protected:
- bool mNewWindowsHidden = true;
- MainEditorWindow* mMainWindow;
- Vector<EditorWindowBase*> mEditorWindows;
- Vector<EditorWindowBase*> mScheduledForDestruction;
- Vector<EditorWindowBase*> mEditorWindowsSnapshot;
- };
- /** @} */
- }
|