2019-12-11 00:51:42 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
2020-04-01 14:53:44 -04:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
2020-05-18 02:03:17 -04:00
|
|
|
#include "PLRegions.h"
|
2021-03-29 21:41:11 -04:00
|
|
|
#include "PLSysCalls.h"
|
2020-05-18 02:03:17 -04:00
|
|
|
|
2019-12-11 00:51:42 -05:00
|
|
|
struct Window;
|
2019-12-30 20:53:11 -05:00
|
|
|
struct DrawSurface;
|
2019-12-11 00:51:42 -05:00
|
|
|
struct GDevice;
|
2019-12-21 18:40:17 -05:00
|
|
|
struct IGpDisplayDriver;
|
2019-12-24 18:39:30 -05:00
|
|
|
struct Point;
|
2020-03-01 17:01:35 -05:00
|
|
|
class PLPasStr;
|
2020-02-25 23:09:09 -05:00
|
|
|
struct Rect;
|
2019-12-24 18:39:30 -05:00
|
|
|
struct Window;
|
2019-12-11 00:51:42 -05:00
|
|
|
|
|
|
|
|
namespace PortabilityLayer
|
|
|
|
|
{
|
|
|
|
|
struct WindowDef;
|
2020-04-05 22:31:22 -04:00
|
|
|
struct Rect2i;
|
2020-05-02 01:51:32 -04:00
|
|
|
struct Vec2i;
|
2019-12-11 00:51:42 -05:00
|
|
|
|
|
|
|
|
class WindowManager
|
|
|
|
|
{
|
|
|
|
|
public:
|
2020-11-30 02:59:02 -05:00
|
|
|
virtual void Init() = 0;
|
2019-12-11 00:51:42 -05:00
|
|
|
virtual Window *GetPutInFrontSentinel() const = 0;
|
|
|
|
|
virtual Window *CreateWindow(const WindowDef &windowDef) = 0;
|
|
|
|
|
virtual void ResizeWindow(Window *window, int width, int height) = 0;
|
|
|
|
|
virtual void MoveWindow(Window *window, int x, int y) = 0;
|
|
|
|
|
virtual void PutWindowBehind(Window *window, Window *otherWindow) = 0;
|
|
|
|
|
virtual void ShowWindow(Window *window) = 0;
|
|
|
|
|
virtual void HideWindow(Window *window) = 0;
|
2019-12-24 18:39:30 -05:00
|
|
|
virtual void FindWindow(const Point &point, Window **outWindow, short *outRegion) const = 0;
|
2019-12-30 20:53:11 -05:00
|
|
|
virtual void DestroyWindow(Window *window) = 0;
|
2021-04-19 02:44:19 -04:00
|
|
|
GP_ASYNCIFY_PARANOID_VIRTUAL void DragWindow(Window *window, const Point &startPoint, const Rect &constraintRect) GP_ASYNCIFY_PARANOID_PURE;
|
|
|
|
|
GP_ASYNCIFY_PARANOID_VIRTUAL bool HandleCloseBoxClick(Window *window, const Point &startPoint) GP_ASYNCIFY_PARANOID_PURE;
|
2020-03-01 17:01:35 -05:00
|
|
|
virtual void SetWindowTitle(Window *window, const PLPasStr &title) = 0;
|
2020-04-05 22:31:22 -04:00
|
|
|
virtual Rect2i GetWindowFullRect(Window *window) const = 0;
|
2020-05-18 02:03:17 -04:00
|
|
|
virtual bool GetWindowChromeInteractionZone(Window *window, const Vec2i &point, RegionID_t &outRegion) const = 0;
|
|
|
|
|
virtual void SwapExclusiveWindow(Window *& windowRef) = 0;
|
2019-12-11 00:51:42 -05:00
|
|
|
|
2021-03-29 21:41:11 -04:00
|
|
|
GP_ASYNCIFY_PARANOID_VIRTUAL void FlickerWindowIn(Window *window, int32_t velocity) GP_ASYNCIFY_PARANOID_PURE;
|
|
|
|
|
GP_ASYNCIFY_PARANOID_VIRTUAL void FlickerWindowOut(Window *window, int32_t velocity) GP_ASYNCIFY_PARANOID_PURE;
|
2020-05-18 03:30:25 -04:00
|
|
|
|
2020-05-22 21:14:43 -04:00
|
|
|
virtual void SetWindowDesaturation(Window *window, float desaturationLevel) = 0;
|
|
|
|
|
|
2020-05-02 01:51:32 -04:00
|
|
|
virtual void SetResizeInProgress(Window *window, const PortabilityLayer::Vec2i &size) = 0;
|
|
|
|
|
virtual void ClearResizeInProgress() = 0;
|
|
|
|
|
|
2019-12-21 18:40:17 -05:00
|
|
|
virtual void RenderFrame(IGpDisplayDriver *displayDriver) = 0;
|
|
|
|
|
|
2020-04-01 14:53:44 -04:00
|
|
|
virtual void HandleScreenResolutionChange(uint32_t prevWidth, uint32_t prevHeight, uint32_t newWidth, uint32_t newHeight) = 0;
|
|
|
|
|
|
2020-06-20 02:08:22 -04:00
|
|
|
virtual void SetBackgroundColor(uint8_t r, uint8_t g, uint8_t b) = 0;
|
|
|
|
|
|
2020-11-30 02:59:02 -05:00
|
|
|
virtual Vec2i GetDisplayResolution() const = 0;
|
|
|
|
|
|
2019-12-11 00:51:42 -05:00
|
|
|
static WindowManager *GetInstance();
|
|
|
|
|
};
|
|
|
|
|
}
|