Files
PowerToys/src/modules/fancyzones/FancyZonesLib/Layout.h
Seraphima Zykova ff290eef9d [FancyZones] Window switch shortcut fix (#21426)
* 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
2022-10-31 11:44:25 +00:00

32 lines
900 B
C++

#pragma once
#include <FancyZonesLib/FancyZonesData/LayoutData.h>
#include <FancyZonesLib/util.h>
#include <FancyZonesLib/LayoutConfigurator.h> // ZonesMap
class Layout
{
public:
Layout(const LayoutData& data);
~Layout() = default;
bool Init(const FancyZonesUtils::Rect& workAreaRect, HMONITOR monitor) noexcept;
GUID Id() const noexcept;
FancyZonesDataTypes::ZoneSetLayoutType Type() const noexcept;
const ZonesMap& Zones() const noexcept;
ZoneIndexSet ZonesFromPoint(POINT pt) const noexcept;
/**
* Returns all zones spanned by the minimum bounding rectangle containing the two given zone index sets.
*/
ZoneIndexSet GetCombinedZoneRange(const ZoneIndexSet& initialZones, const ZoneIndexSet& finalZones) const noexcept;
RECT GetCombinedZonesRect(const ZoneIndexSet& zones);
private:
const LayoutData m_data;
ZonesMap m_zones{};
};