2024-04-30 03:41:27 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "../defines.hpp"
|
|
|
|
#include "WLSurface.hpp"
|
|
|
|
#include "../helpers/AnimatedVariable.hpp"
|
|
|
|
|
|
|
|
struct SLayerRule {
|
|
|
|
std::string targetNamespace = "";
|
|
|
|
std::string rule = "";
|
|
|
|
};
|
|
|
|
|
2024-05-09 22:47:21 +02:00
|
|
|
class CLayerShellResource;
|
|
|
|
|
2024-04-30 03:41:27 +02:00
|
|
|
class CLayerSurface {
|
|
|
|
public:
|
2024-05-09 22:47:21 +02:00
|
|
|
static PHLLS create(SP<CLayerShellResource>);
|
2024-04-30 03:41:27 +02:00
|
|
|
|
|
|
|
private:
|
2024-05-09 22:47:21 +02:00
|
|
|
CLayerSurface(SP<CLayerShellResource>);
|
2024-04-30 03:41:27 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
~CLayerSurface();
|
|
|
|
|
|
|
|
void applyRules();
|
|
|
|
void startAnimation(bool in, bool instant = false);
|
|
|
|
bool isFadedOut();
|
|
|
|
int popupsCount();
|
|
|
|
|
|
|
|
CAnimatedVariable<Vector2D> realPosition;
|
|
|
|
CAnimatedVariable<Vector2D> realSize;
|
|
|
|
CAnimatedVariable<float> alpha;
|
|
|
|
|
2024-05-09 22:47:21 +02:00
|
|
|
WP<CLayerShellResource> layerSurface;
|
2024-04-30 03:41:27 +02:00
|
|
|
wl_list link;
|
|
|
|
|
|
|
|
bool keyboardExclusive = false;
|
|
|
|
|
|
|
|
CWLSurface surface;
|
|
|
|
|
|
|
|
bool mapped = false;
|
2024-05-09 22:47:21 +02:00
|
|
|
uint32_t layer = 0;
|
2024-04-30 03:41:27 +02:00
|
|
|
|
|
|
|
int monitorID = -1;
|
|
|
|
|
|
|
|
bool fadingOut = false;
|
|
|
|
bool readyToDelete = false;
|
|
|
|
bool noProcess = false;
|
|
|
|
bool noAnimations = false;
|
|
|
|
|
|
|
|
bool forceBlur = false;
|
|
|
|
bool forceBlurPopups = false;
|
|
|
|
int xray = -1;
|
|
|
|
bool ignoreAlpha = false;
|
|
|
|
float ignoreAlphaValue = 0.f;
|
|
|
|
bool dimAround = false;
|
|
|
|
|
|
|
|
std::optional<std::string> animationStyle;
|
|
|
|
|
|
|
|
PHLLSREF self;
|
|
|
|
|
|
|
|
CBox geometry = {0, 0, 0, 0};
|
|
|
|
Vector2D position;
|
|
|
|
std::string szNamespace = "";
|
2024-05-09 22:47:21 +02:00
|
|
|
std::unique_ptr<CPopup> popupHead;
|
2024-04-30 03:41:27 +02:00
|
|
|
|
|
|
|
void onDestroy();
|
|
|
|
void onMap();
|
|
|
|
void onUnmap();
|
|
|
|
void onCommit();
|
|
|
|
|
|
|
|
private:
|
2024-05-09 22:47:21 +02:00
|
|
|
struct {
|
|
|
|
CHyprSignalListener destroy;
|
|
|
|
CHyprSignalListener map;
|
|
|
|
CHyprSignalListener unmap;
|
|
|
|
CHyprSignalListener commit;
|
|
|
|
} listeners;
|
2024-04-30 03:41:27 +02:00
|
|
|
|
|
|
|
void registerCallbacks();
|
|
|
|
|
|
|
|
// For the list lookup
|
|
|
|
bool operator==(const CLayerSurface& rhs) const {
|
|
|
|
return layerSurface == rhs.layerSurface && monitorID == rhs.monitorID;
|
|
|
|
}
|
|
|
|
};
|