4#include "HotKeyComponent.hpp"
6#include "SubWindow.hpp"
9#include <unordered_map>
23 using SWFactoryTable =
24 std::unordered_map<ESWTypes, std::function<SubWindow::Ptr(Recti, SWHolderType)>>;
27 SWManager(
const Recti& rect,
MainWindow& mainWindow);
29 template <std::derived_from<SubWindow> T>
30 void RegisterSW(ESWTypes swType);
34 void AddSWEvent(
SWEvent swEvent);
35 void EventLoopIterationStart();
36 void HandleUserEvent(
Event event);
37 void HandleSWEvents();
40 void HandleResizeEvent(Recti newRect);
46 SubWindow::Ptr CreateSubWindow(ESWTypes swType, SWHolderType holderType);
48 void SelectTopInfoHolder();
49 void SelectMainHolder();
50 void SelectAdditionalHolder();
52 void InitializeHotKeyActions();
53 void InitializePosElementsSize();
57 SWHolder& GetSWHolder(SWHolderType holderType);
58 inline size_t GetSWIndex(ESWTypes swType)
const;
59 Recti GetBoundsFromPosType(PositionType posType)
const;
67 Recti mTopElementRect;
68 Recti mOneMidElementRect;
69 Recti mLeftElementRect;
70 Recti mRightElementRect;
71 Recti mCentralElementRect;
73 std::array<SWHolder, 4> mSWHolders;
74 std::vector<SubWindow::Ptr> mSubWindows;
75 SWFactoryTable mFactories;
77 std::vector<SWEvent> mSWEvents;
81template <std::derived_from<SubWindow> T>
82void SWManager::RegisterSW(ESWTypes swType)
84 mFactories[swType] = [
this](
85 Recti bounds, SWHolderType inHolderType = SWHolderType::None)
86 {
return std::make_unique<T>(bounds, mContext, inHolderType); };
The HotKeyComponent class - class to handle pre defined bindings.
Definition HotKeyComponent.hpp:20
The MainWindow class.
Definition MainWindow.hpp:19
The SWHolder class does not own SubWindows It's only responsible for Positions, Size,...
Definition SWHolder.hpp:35
void InitStartupState()
SWManager::InitStartupState.
Definition SWManager.cpp:70
void setRawInputMode(bool rawInputMode)
if rawInputMode enabled for class, it's hotkeys(hotkeycomponent) won't be processed
Definition SWManager.cpp:404
void UpdatePosElementsSize()
SWManager::UpdatePosElementsSize.
Definition SWManager.cpp:285
Definition Context.hpp:14
Definition Primitives.hpp:88
SubWindow Event.
Definition SubWindow.hpp:56