mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
* rename Layout -> LayoutData * simplify zone * split ZoneSet: Layout * refactoring * split ZoneSet: LayoutWindows * update trace * split ZoneSet: remove ZoneSet * fix initialization * split unit tests * remove unused * warning * nullptr check * use current rect * update work area tests * use current rect * simplify * more meaningful name * dismiss * safety checks * resolve conflicts * reassign windows after switching vd * avoid double-processing for window on switching vd * extend windows fix * check if window is on current desktop before cycling * separated extend * not reinit layout windows
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#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);
|
|
|
|
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;
|
|
};
|