2021-11-21 13:11:51 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../defines.hpp"
|
2021-11-21 18:34:20 +01:00
|
|
|
#include <fstream>
|
2021-12-10 21:55:41 +01:00
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
// For precise colors
|
|
|
|
class CFloatingColor {
|
|
|
|
public:
|
|
|
|
float r = 0;
|
|
|
|
float g = 0;
|
|
|
|
float b = 0;
|
|
|
|
float a = 255;
|
|
|
|
|
|
|
|
uint32_t getAsUint32() {
|
|
|
|
return ((int)round(a)) * 0x1000000 + ((int)round(r)) * 0x10000 + ((int)round(g)) * 0x100 + ((int)round(b));
|
|
|
|
}
|
|
|
|
|
|
|
|
CFloatingColor(uint32_t c) {
|
|
|
|
r = RED(c) * 255.f;
|
|
|
|
g = GREEN(c) * 255.f;
|
|
|
|
b = BLUE(c) * 255.f;
|
|
|
|
a = ALPHA(c) * 255.f;
|
|
|
|
}
|
|
|
|
|
|
|
|
CFloatingColor() {
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
2021-12-21 18:30:35 +01:00
|
|
|
CFloatingColor& operator=(uint32_t c) {
|
|
|
|
r = RED(c) * 255.f;
|
|
|
|
g = GREEN(c) * 255.f;
|
|
|
|
b = BLUE(c) * 255.f;
|
|
|
|
a = ALPHA(c) * 255.f;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2021-12-10 21:55:41 +01:00
|
|
|
bool operator==(CFloatingColor B) {
|
|
|
|
return r == B.r && g == B.g && b == B.b && a == B.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator!=(CFloatingColor B) {
|
|
|
|
return !(r == B.r && g == B.g && b == B.b && a == B.a);
|
|
|
|
}
|
|
|
|
};
|
2021-11-21 13:11:51 +01:00
|
|
|
|
2021-12-19 12:33:36 +01:00
|
|
|
enum EDockAlign {
|
|
|
|
DOCK_LEFT = 0,
|
|
|
|
DOCK_RIGHT,
|
|
|
|
DOCK_TOP,
|
|
|
|
DOCK_BOTTOM
|
|
|
|
};
|
|
|
|
|
2021-11-21 13:11:51 +01:00
|
|
|
std::string exec(const char* cmd);
|
2021-11-21 18:34:20 +01:00
|
|
|
void clearLogs();
|
2021-12-09 21:58:20 +01:00
|
|
|
void emptyEvent(xcb_drawable_t window = 0);
|
|
|
|
void wakeUpEvent(xcb_drawable_t window);
|
2021-11-24 18:37:45 +01:00
|
|
|
bool xcbContainsAtom(xcb_get_property_reply_t* PROP, xcb_atom_t ATOM);
|
2021-11-23 18:48:03 +01:00
|
|
|
|
2021-12-10 21:55:41 +01:00
|
|
|
CFloatingColor parabolicColor(CFloatingColor from, uint32_t to, double incline);
|
|
|
|
CFloatingColor parabolicColor(CFloatingColor from, CFloatingColor to, double incline);
|
|
|
|
|
2021-11-27 19:07:33 +01:00
|
|
|
double parabolic(double from, double to, double incline);
|
|
|
|
|
|
|
|
std::vector<std::string> splitString(std::string, char);
|