#pragma once #define WLR_USE_UNSTABLE #include "globals.hpp" #include #include #include #include #include // saves on resources, but is a bit broken rn with blur. // hyprland's fault, but cba to fix. constexpr bool ENABLE_LOWRES = false; class CMonitor; class COverview { public: COverview(PHLWORKSPACE startedOn_, bool swipe = false); ~COverview(); void render(); void damage(); void onDamageReported(); void onPreRender(); void onSwipeUpdate(double delta); void onSwipeEnd(); // close without a selection void close(); bool blockOverviewRendering = false; bool blockDamageReporting = false; PHLMONITORREF pMonitor; private: void redrawID(int id, bool forcelowres = false); void redrawAll(bool forcelowres = false); void onWorkspaceChange(); int SIDE_LENGTH = 3; int GAP_WIDTH = 5; CHyprColor BG_COLOR = CHyprColor{0.1, 0.1, 0.1, 1.0}; bool damageDirty = false; struct SWorkspaceImage { CFramebuffer fb; int64_t workspaceID = -1; PHLWORKSPACE pWorkspace; CBox box; }; Vector2D lastMousePosLocal = Vector2D{}; int openedID = -1; int closeOnID = -1; std::vector images; PHLWORKSPACE startedOn; CAnimatedVariable size; CAnimatedVariable pos; bool closing = false; SP mouseMoveHook; SP mouseButtonHook; SP touchMoveHook; SP touchDownHook; bool swipe = false; bool swipeWasCommenced = false; }; inline std::unique_ptr g_pOverview;