2020-08-26 00:55:29 +08:00
|
|
|
#pragma once
|
|
|
|
|
2020-10-26 16:07:11 +08:00
|
|
|
#include <map>
|
2020-08-26 00:55:29 +08:00
|
|
|
#include <vector>
|
|
|
|
#include <wil\resource.h>
|
|
|
|
#include <winrt/base.h>
|
2020-10-14 20:45:50 +08:00
|
|
|
#include <d2d1.h>
|
2020-08-26 00:55:29 +08:00
|
|
|
|
|
|
|
#include "util.h"
|
|
|
|
#include "Zone.h"
|
2020-10-26 16:07:11 +08:00
|
|
|
#include "ZoneSet.h"
|
2020-08-26 00:55:29 +08:00
|
|
|
|
2020-10-14 20:45:50 +08:00
|
|
|
namespace ZoneWindowDrawingNS
|
2020-08-26 00:55:29 +08:00
|
|
|
{
|
|
|
|
struct ColorSetting
|
|
|
|
{
|
|
|
|
BYTE fillAlpha{};
|
|
|
|
COLORREF fill{};
|
|
|
|
BYTE borderAlpha{};
|
|
|
|
COLORREF border{};
|
|
|
|
int thickness{};
|
|
|
|
};
|
|
|
|
|
|
|
|
void DrawBackdrop(wil::unique_hdc& hdc, RECT const& clientRect) noexcept;
|
|
|
|
void DrawActiveZoneSet(wil::unique_hdc& hdc,
|
|
|
|
COLORREF zoneColor,
|
|
|
|
COLORREF zoneBorderColor,
|
|
|
|
COLORREF highlightColor,
|
|
|
|
int zoneOpacity,
|
2020-10-26 16:07:11 +08:00
|
|
|
const IZoneSet::ZonesMap& zones,
|
2020-08-26 00:55:29 +08:00
|
|
|
const std::vector<size_t>& highlightZones,
|
2020-10-15 23:08:55 +08:00
|
|
|
bool flashMode) noexcept;
|
2020-08-26 00:55:29 +08:00
|
|
|
}
|
2020-10-14 20:45:50 +08:00
|
|
|
|
|
|
|
class ZoneWindowDrawing
|
|
|
|
{
|
|
|
|
HWND m_window;
|
|
|
|
winrt::com_ptr<IZoneWindowHost> m_host;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ZoneWindowDrawing(HWND window);
|
|
|
|
void StartAnimation(unsigned millis);
|
|
|
|
void DrawActiveZoneSet(const std::vector<winrt::com_ptr<IZone>>& zones, const std::vector<size_t>& highlightZones);
|
|
|
|
};
|