mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-15 23:25:59 +01:00
4b4971c06f
* framebuffer: avoid gluint overflow GLuint was being initialized to -1 and rolling over to unsigned int max, its defined behaviour but very unnecessery. add a bool and use it for checking if allocated or not. * opengl: avoid gluint rollover -1 rolls over to unsigned int max, use 0xFF instead. * core: big uint64_t to int type conversion there were a few uint64_t to int implicit conversions overflowing int and causing UB, make all monitor/workspaces/windows use the new typedefs. also fix the various related 64 to 32 implicit conversions going around found with -Wshorten-64-to-32
87 lines
2.5 KiB
C++
87 lines
2.5 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include "../defines.hpp"
|
|
#include "WLSurface.hpp"
|
|
#include "../helpers/AnimatedVariable.hpp"
|
|
|
|
struct SLayerRule {
|
|
std::string targetNamespace = "";
|
|
std::string rule = "";
|
|
};
|
|
|
|
class CLayerShellResource;
|
|
|
|
class CLayerSurface {
|
|
public:
|
|
static PHLLS create(SP<CLayerShellResource>);
|
|
|
|
private:
|
|
CLayerSurface(SP<CLayerShellResource>);
|
|
|
|
public:
|
|
~CLayerSurface();
|
|
|
|
void applyRules();
|
|
void startAnimation(bool in, bool instant = false);
|
|
bool isFadedOut();
|
|
int popupsCount();
|
|
|
|
CAnimatedVariable<Vector2D> realPosition;
|
|
CAnimatedVariable<Vector2D> realSize;
|
|
CAnimatedVariable<float> alpha;
|
|
|
|
WP<CLayerShellResource> layerSurface;
|
|
wl_list link;
|
|
|
|
// the header providing the enum type cannot be imported here
|
|
int interactivity = 0;
|
|
|
|
SP<CWLSurface> surface;
|
|
|
|
bool mapped = false;
|
|
uint32_t layer = 0;
|
|
|
|
MONITORID monitorID = -1;
|
|
|
|
bool fadingOut = false;
|
|
bool readyToDelete = false;
|
|
bool noProcess = false;
|
|
bool noAnimations = false;
|
|
|
|
bool forceBlur = false;
|
|
bool forceBlurPopups = false;
|
|
int64_t 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 = "";
|
|
std::unique_ptr<CPopup> popupHead;
|
|
|
|
void onDestroy();
|
|
void onMap();
|
|
void onUnmap();
|
|
void onCommit();
|
|
|
|
private:
|
|
struct {
|
|
CHyprSignalListener destroy;
|
|
CHyprSignalListener map;
|
|
CHyprSignalListener unmap;
|
|
CHyprSignalListener commit;
|
|
} listeners;
|
|
|
|
void registerCallbacks();
|
|
|
|
// For the list lookup
|
|
bool operator==(const CLayerSurface& rhs) const {
|
|
return layerSurface == rhs.layerSurface && monitorID == rhs.monitorID;
|
|
}
|
|
};
|