2019-09-05 00:26:26 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Zone.h"
|
|
|
|
|
|
|
|
enum class ZoneSetLayout
|
|
|
|
{
|
|
|
|
Grid,
|
|
|
|
Row,
|
|
|
|
Focus,
|
|
|
|
Custom
|
|
|
|
};
|
|
|
|
|
|
|
|
interface __declspec(uuid("{E4839EB7-669D-49CF-84A9-71A2DFD851A3}")) IZoneSet : public IUnknown
|
|
|
|
{
|
|
|
|
IFACEMETHOD_(GUID, Id)() = 0;
|
|
|
|
IFACEMETHOD_(WORD, LayoutId)() = 0;
|
2019-11-19 07:29:42 +08:00
|
|
|
IFACEMETHOD(AddZone)(winrt::com_ptr<IZone> zone) = 0;
|
2019-09-05 00:26:26 +08:00
|
|
|
IFACEMETHOD_(winrt::com_ptr<IZone>, ZoneFromPoint)(POINT pt) = 0;
|
|
|
|
IFACEMETHOD_(int, GetZoneIndexFromWindow)(HWND window) = 0;
|
|
|
|
IFACEMETHOD_(std::vector<winrt::com_ptr<IZone>>, GetZones)() = 0;
|
|
|
|
IFACEMETHOD_(void, Save)() = 0;
|
|
|
|
IFACEMETHOD_(void, MoveWindowIntoZoneByIndex)(HWND window, HWND zoneWindow, int index) = 0;
|
|
|
|
IFACEMETHOD_(void, MoveWindowIntoZoneByDirection)(HWND window, HWND zoneWindow, DWORD vkCode) = 0;
|
|
|
|
IFACEMETHOD_(void, MoveSizeEnd)(HWND window, HWND zoneWindow, POINT ptClient) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define VERSION_PERSISTEDDATA 0x0000F00D
|
|
|
|
struct ZoneSetPersistedData
|
|
|
|
{
|
2019-11-08 02:56:32 +08:00
|
|
|
static constexpr inline size_t MAX_ZONES = 40;
|
|
|
|
|
2019-09-05 00:26:26 +08:00
|
|
|
DWORD Version{VERSION_PERSISTEDDATA};
|
|
|
|
WORD LayoutId{};
|
|
|
|
DWORD ZoneCount{};
|
|
|
|
ZoneSetLayout Layout{};
|
|
|
|
DWORD PaddingInner{};
|
|
|
|
DWORD PaddingOuter{};
|
2019-11-08 02:56:32 +08:00
|
|
|
RECT Zones[MAX_ZONES]{};
|
2019-09-05 00:26:26 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ZoneSetConfig
|
|
|
|
{
|
|
|
|
ZoneSetConfig(
|
|
|
|
GUID id,
|
|
|
|
WORD layoutId,
|
|
|
|
HMONITOR monitor,
|
2019-11-19 07:29:42 +08:00
|
|
|
PCWSTR resolutionKey) noexcept :
|
2019-09-05 00:26:26 +08:00
|
|
|
Id(id),
|
|
|
|
LayoutId(layoutId),
|
|
|
|
Monitor(monitor),
|
2019-11-19 07:29:42 +08:00
|
|
|
ResolutionKey(resolutionKey)
|
2019-09-05 00:26:26 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
GUID Id{};
|
|
|
|
WORD LayoutId{};
|
|
|
|
HMONITOR Monitor{};
|
|
|
|
PCWSTR ResolutionKey{};
|
|
|
|
};
|
|
|
|
|
|
|
|
winrt::com_ptr<IZoneSet> MakeZoneSet(ZoneSetConfig const& config) noexcept;
|