Hyprland/src/layout/MasterLayout.hpp

58 lines
1.8 KiB
C++
Raw Normal View History

2022-07-16 15:57:31 +02:00
#pragma once
#include "IHyprLayout.hpp"
#include <list>
#include <deque>
enum eFullscreenMode : uint8_t;
struct SMasterNodeData {
bool isMaster = false;
float percMaster = 0.5f;
CWindow* pWindow = nullptr;
Vector2D position;
Vector2D size;
int workspaceID = -1;
bool operator==(const SMasterNodeData& rhs) {
return pWindow == rhs.pWindow;
}
};
class CHyprMasterLayout : public IHyprLayout {
public:
virtual void onWindowCreatedTiling(CWindow*);
virtual void onWindowRemovedTiling(CWindow*);
virtual bool isWindowTiled(CWindow*);
virtual void recalculateMonitor(const int&);
virtual void recalculateWindow(CWindow*);
virtual void resizeActiveWindow(const Vector2D&, CWindow* pWindow = nullptr);
virtual void fullscreenRequestForWindow(CWindow*, eFullscreenMode, bool);
virtual std::any layoutMessage(SLayoutMessageHeader, std::string);
virtual SWindowRenderLayoutHints requestRenderHints(CWindow*);
virtual void switchWindows(CWindow*, CWindow*);
virtual void alterSplitRatioBy(CWindow*, float);
virtual std::string getLayoutName();
virtual void onEnable();
virtual void onDisable();
private:
std::list<SMasterNodeData> m_lMasterNodesData;
bool m_bForceWarps = false;
2022-07-16 15:57:31 +02:00
int getNodesOnWorkspace(const int&);
void applyNodeDataToWindow(SMasterNodeData*);
SMasterNodeData* getNodeFromWindow(CWindow*);
SMasterNodeData* getMasterNodeOnWorkspace(const int&);
void calculateWorkspace(const int&);
2022-08-24 21:50:48 +02:00
CWindow* getNextWindow(CWindow*, bool);
2022-11-08 13:39:52 +01:00
int getMastersOnWorkspace(const int&);
2022-07-16 15:57:31 +02:00
friend struct SMasterNodeData;
};