mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Document fancy zones (#1496)
This commit is contained in:
@@ -3,18 +3,80 @@
|
||||
#include "Zone.h"
|
||||
#include "JsonHelpers.h"
|
||||
|
||||
|
||||
/**
|
||||
* Class representing single zone layout. ZoneSet is responsible for actual calculation of rectangle coordinates
|
||||
* (whether is grid or canvas layout) and moving windows through them.
|
||||
*/
|
||||
interface __declspec(uuid("{E4839EB7-669D-49CF-84A9-71A2DFD851A3}")) IZoneSet : public IUnknown
|
||||
{
|
||||
/**
|
||||
* @returns Unique identifier of zone layout.
|
||||
*/
|
||||
IFACEMETHOD_(GUID, Id)() = 0;
|
||||
/**
|
||||
* @returns Type of the zone layout. Layout type can be focus, columns, rows, grid, priority grid or custom.
|
||||
*/
|
||||
IFACEMETHOD_(JSONHelpers::ZoneSetLayoutType, LayoutType)() = 0;
|
||||
/**
|
||||
* Add zone to the zone layout.
|
||||
*
|
||||
* @param zone Zone object (defining coordinates of the zone).
|
||||
*/
|
||||
IFACEMETHOD(AddZone)(winrt::com_ptr<IZone> zone) = 0;
|
||||
/**
|
||||
* Get zone from cursor coordinates.
|
||||
*
|
||||
* @param pt Cursor coordinates.
|
||||
* @returns Zone object (defining coordinates of the zone).
|
||||
*/
|
||||
IFACEMETHOD_(winrt::com_ptr<IZone>, ZoneFromPoint)(POINT pt) = 0;
|
||||
/**
|
||||
* Get index of the zone inside zone layout by window assigned to it.
|
||||
*
|
||||
* @param window Handle of window assigned to zone.
|
||||
* @returns Zone index withing zone layout.
|
||||
*/
|
||||
IFACEMETHOD_(int, GetZoneIndexFromWindow)(HWND window) = 0;
|
||||
/**
|
||||
* @returns Array of zone objects (defining coordinates of the zone) inside this zone layout.
|
||||
*/
|
||||
IFACEMETHOD_(std::vector<winrt::com_ptr<IZone>>, GetZones)() = 0;
|
||||
/**
|
||||
* Assign window to the zone based on zone index inside zone layout.
|
||||
*
|
||||
* @param window Handle of window which should be assigned to zone.
|
||||
* @param zoneWindow The m_window of a ZoneWindow, it's a hidden window representing the
|
||||
* current monitor desktop work area.
|
||||
* @param index Zone index within zone layout.
|
||||
*/
|
||||
IFACEMETHOD_(void, MoveWindowIntoZoneByIndex)(HWND window, HWND zoneWindow, int index) = 0;
|
||||
/**
|
||||
* Assign window to the zone based on direction (using WIN + LEFT/RIGHT arrow).
|
||||
*
|
||||
* @param window Handle of window which should be assigned to zone.
|
||||
* @param zoneWindow The m_window of a ZoneWindow, it's a hidden window representing the
|
||||
* current monitor desktop work area.
|
||||
* @param vkCode Pressed arrow key.
|
||||
*/
|
||||
IFACEMETHOD_(void, MoveWindowIntoZoneByDirection)(HWND window, HWND zoneWindow, DWORD vkCode) = 0;
|
||||
/**
|
||||
* Assign window to the zone based on cursor coordinates.
|
||||
*
|
||||
* @param window Handle of window which should be assigned to zone.
|
||||
* @param zoneWindow The m_window of a ZoneWindow, it's a hidden window representing the
|
||||
* current monitor desktop work area.
|
||||
* @param pt Cursor coordinates.
|
||||
*/
|
||||
IFACEMETHOD_(void, MoveWindowIntoZoneByPoint)(HWND window, HWND zoneWindow, POINT ptClient) = 0;
|
||||
/**
|
||||
* Calculate zone coordinates within zone layout based on number of zones and spacing. Used for one of
|
||||
* the predefined layouts (focus, columns, rows, grid, priority grid) or for custom layout.
|
||||
*
|
||||
* @param monitorInfo Information about monitor on which zone layout is applied.
|
||||
* @param zoneCount Number of zones inside zone layout.
|
||||
* @param spacing Spacing between zones in pixels.
|
||||
* @returns Boolean if calculation was successful.
|
||||
*/
|
||||
IFACEMETHOD_(bool, CalculateZones)(MONITORINFO monitorInfo, int zoneCount, int spacing) = 0;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user