2022-10-31 13:44:25 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <FancyZonesLib/Zone.h>
|
|
|
|
|
|
|
|
|
|
class LayoutAssignedWindows
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
struct ExtendWindowModeData
|
|
|
|
|
{
|
|
|
|
|
std::map<HWND, ZoneIndexSet> windowInitialIndexSet;
|
|
|
|
|
std::map<HWND, ZoneIndex> windowFinalIndex;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public :
|
|
|
|
|
LayoutAssignedWindows();
|
|
|
|
|
~LayoutAssignedWindows() = default;
|
|
|
|
|
|
|
|
|
|
void Assign(HWND window, const ZoneIndexSet& zones);
|
|
|
|
|
void Extend(HWND window, const ZoneIndexSet& zones);
|
|
|
|
|
void Dismiss(HWND window);
|
|
|
|
|
|
2023-02-06 17:15:19 +01:00
|
|
|
std::map<HWND, ZoneIndexSet> SnappedWindows() const noexcept;
|
2022-10-31 13:44:25 +02:00
|
|
|
ZoneIndexSet GetZoneIndexSetFromWindow(HWND window) const noexcept;
|
|
|
|
|
bool IsZoneEmpty(ZoneIndex zoneIndex) const noexcept;
|
|
|
|
|
|
|
|
|
|
void CycleWindows(HWND window, bool reverse);
|
|
|
|
|
|
|
|
|
|
const std::unique_ptr<ExtendWindowModeData>& ExtendWindowData();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::map<HWND, ZoneIndexSet> m_windowIndexSet{};
|
|
|
|
|
std::map<ZoneIndexSet, std::vector<HWND>> m_windowsByIndexSets{};
|
|
|
|
|
std::unique_ptr<ExtendWindowModeData> m_extendData{}; // Needed for ExtendWindowByDirectionAndPosition
|
|
|
|
|
|
|
|
|
|
void InsertWindowIntoZone(HWND window, std::optional<size_t> tabSortKeyWithinZone, const ZoneIndexSet& indexSet);
|
|
|
|
|
HWND GetNextZoneWindow(ZoneIndexSet indexSet, HWND current, bool reverse) noexcept;
|
|
|
|
|
};
|